忘れないように覚書
/includes/classes/functions.php
//ClipBucket uses PHPMailer for sending emails include_once("classes/phpmailer/class.phpmailer.php"); include_once("classes/phpmailer/class.smtp.php"); mb_language("japanese"); mb_internal_encoding("utf-8"); $mail = new PHPMailer(); // defaults to using php "mail()" $mail->CharSet = "iso-2022-jp"; $mail->Encoding = "7bit"; $mail_type = config('mail_type'); //---Setting SMTP --- if($mail_type=='smtp') { $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = config('smtp_host'); // SMTP server if(config('smtp_auth')=='yes') $mail->SMTPAuth = true; // enable SMTP authentication $mail->Port = config('smtp_port'); // set the SMTP port for the GMAIL server $mail->Username = config('smtp_user'); // SMTP account username $mail->Password = config('smtp_pass'); // SMTP account password } //--- Ending Smtp Settings $mail->SetFrom($from, $from_name); $mail->AddAddress($to, $to_name); //$mail->Subject = $subject; $mail->Subject = mb_encode_mimeheader(mb_convert_encoding($subject,"JIS","utf-8")); $message = mb_convert_encoding($message,"JIS","utf-8"); $mail->MsgHTML($message); if(!$mail->Send()) { e("Mailer Error: " . $mail->ErrorInfo); return false; }else return true; } function send_email($from,$to,$subj,$message) { return cbmail(array('from'=>$from,'to'=>$to,'subject'=>$subj,'content'=>$message)); }