Welcome Guest, Not a member yet? Register   Sign In
Email Class - not interpreting line breaks
#1

[eluser]Joey Marchy[/eluser]
My email is being delivered, but the line breaks appear inline in the message body. I'm wondering if I have something out of order in the code or if I'm missing something simple. I'm running this on my local machine. Thanks!

Email example
Congratulations!rnYou have earned a certificate of completion for the
following course: Environmental Studies: Communication and
Researchrn12-12-2008rn

Code:
$this->load->library('email');
$this->email->clear();
      
$config['mailtype'] = 'text';
$config['newline'] = '\r\n';
$config['crlf'] = '\r\n';
$config['protocol'] = 'sendmail';
$this->email->initialize($config);

...
        
$message = 'Congratulations!\r\n';
$message .= 'You have earned a certificate of completion for the following course: ';
$message .= $title . '\r\n';
$this->email->message($message);
$this->email->set_alt_message($message_alt);
$this->email->send();

Email Debug
Your message has been successfully sent using the following protocol: sendmail
User-Agent: CodeIgniter
Date: Fri, 12 Dec 2008 11:12:11 -0500
From: "Apollidon Course Certificate"
Return-Path:
To: [email protected]
Bcc: [email protected], [email protected], [email protected]
Subject: Course Certificate: Environmental Studies: Communication and Research
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
#2

[eluser]thinkigniter[/eluser]
Try
Code:
$message .= $title . "\r\n";
#3

[eluser]Joey Marchy[/eluser]
Woo hoo! That was it. Thank you sir.
#4

[eluser]Unknown[/eluser]
I just wanted to note that this resolved a problem I was having too. Thanks, thinkigniter!




Theme © iAndrew 2016 - Forum software by © MyBB