php发送邮件
//バッチ処理アラートメール private static function send_mail($message) { $email_addresses = array( "w_ga@group.co.jp", ); $toStr = implode(",", $email_addresses); $subject = "同期ファイル作成失敗"; $subject = "=?UTF-8?B?".base64_encode($subject)."?="; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/plain; charset=utf-8\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; //$headers .= "From: borg <w_ga@group.co.jp>\r\n"; \Log::debug("メールは送信START"); $result = mail($toStr, $subject, $message, $headers); \Log::debug("メールは送信END"); //送信失敗の場合、ログを出す if (!$result) { \Log::error("メールは送信失敗。"); } else { \Log::debug("メールは送信成功。"); } }