$MSG = "Dear " . $student['firstname'] . " " . $student['lastname'] . ", " . $student['class'] . " " . $student['section'] . " your userid & pass for school SIS is " . $student['username'] . " & " . $student['password'] . " Login at: " . $stu_setting['short_url'] . ", Welcome to " . $stu_setting['name'] . ".";
$skool = "Welcome to " . $stu_setting['name'] . " SIS";
$to_email = 'support@digitave.com';
$this->CI->email->from('noreply@digi-sis.org');
$this->CI->email->to($to_email);
$this->CI->email->subject($skool);
$this->CI->email->message($MSG);
$this->CI->email->send();
使用https://github.com/ivantcholakov/codeigniter-phpmailer在CI中发送电子邮件,但每当我尝试发送电子邮件时,它都会以随机混合字符更改变量值。但它正确加载了MSG。
答案 0 :(得分:1)
将 crlf 更改为 \ r \ n 并设置 charset UTF-8 解决了这个问题。