Abhishek Mishra
Abhishek Mishra

Reputation: 25

CodeIgniter PHP Mailer Issue

     $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 = '[email protected]';
     $this->CI->email->from('[email protected]'); 
     $this->CI->email->to($to_email);
     $this->CI->email->subject($skool); 
     $this->CI->email->message($MSG);    
     $this->CI->email->send();

using https://github.com/ivantcholakov/codeigniter-phpmailer for sending Email in CI, but whenever i am trying to send an email it changes the variables values in random mixed characters. but it loads $MSG correctly.

Mail Screenshot: https://i.sstatic.net/1wDkm.png

Upvotes: 0

Views: 37

Answers (1)

Abhishek Mishra
Abhishek Mishra

Reputation: 25

Changing crlf to \r\n and setting charset UTF-8 solved the problem.

Upvotes: 1

Related Questions