Welcome Guest, Not a member yet? Register   Sign In
Possible BUG in email function
#1

[eluser]novacom[/eluser]
Hi !

I tried to nail down this issue... Please advise if this has been answered before Wink

using :

Code:
...  
   $config['newline'] = "\r\n";
   $config['crlf'] = "\r\n";
   $config['wordwrap'] = "FALSE";
   $this->email->initialize($config);
   ...

In a text/plain email message, some \n are simply ignored... on a random basis.

- some of the \n works so it is not an html mail.
- all \n are passed through double-quotes
- if I use \n\n in place of my \n, if do get double new lines as in
Code:
<br><br> or <p>

- also tried to use " \n " (space before and after) without success
- my message is built in a $message variable using $message .= "text"


This is driving me crazy. I would prefer not to use HTLM for this mail.

Anyone have a cure for this ?

Thanks !
#2

[eluser]Jamie Rumbelow[/eluser]
I don't think this is an email class issue because I use exactly the same settings in my code and it's never done anything like that... could you post your phpinfo()?

Jamie
#3

[eluser]sophistry[/eluser]
@novacom ... are you looking at the $message variable before it is sent or at the email after it is received? it would make a big difference if it were the latter.
#4

[eluser]novacom[/eluser]
Thanks for your answers...

Code:
$message .= "ADMIN level : Your new password is now = ";
       $message .= $data['row']['passwd']."\n";
       $message .= "More text\n";

Does not include a line break after the included data in the received email.

It shows this behavior on both my devloppement server AND my production server.
Production is Apache Version Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a
Developpement is Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8

The results are seen in outlook 2003 right now...

Thanks
#5

[eluser]sophistry[/eluser]
post the email as you see it in outlook, WITH headers. sometimes email clients or receiving servers will interfere with your email and try to "fix" it.
#6

[eluser]novacom[/eluser]
You were right !

I have set up a test account with Thunderbird and the result provens to be also different. (du to 72 char. line wrap) Then I looked closely à the top bar in Outlook saying the message has too many line feed. (don't have the exact sentence, my version is in french : "Les sauts de ligne en surnombres de ce message ont été supprimés.")

And since it is clearly a client issue, it is not a bug of PHP / Codeigniter.

Now my only viable option would be to use HTML in my emails so that I could control the output more precisly. I wrongly tough that text-only mail would be handled as is...

Thanks for your support !

Francis
#7

[eluser]sophistry[/eluser]
no problem... welcome to CI!
#8

[eluser]novacom[/eluser]
It is not a problem with Apache, php or Code Igniter... Just an outlook behavior regarding multiple line feeds Smile

Thanks !
#9

[eluser]ToddyBoy[/eluser]
For some reason, Hotmail or Thunderbird are not recognising the \r or \n to create a new line in emails I send form CI. I've even created an email config file with the following in it.

Code:
$config['crlf'] = '\r\n';
$config['newline'] = '\r\n';

I put in the following to make sure it was using the config file and it was. Funny output from it too.
Code:
$config['wrapchars'] = 10;

The headers on Thunderbird didn't seem to help at all either. Anyone have any clues?
#10

[eluser]novacom[/eluser]
Hi !

Here was my $config :

Code:
$config['newline'] = "\r\n";
   $config['crlf'] = "\r\n";
   $config['wordwrap'] = "FALSE";

I must admit that i now send my emails using HTML :

Code:
$config['mailtype'] = "html";

Hope it helps you... from Thunderbird, it always worked fine for me.

Francis




Theme © iAndrew 2016 - Forum software by © MyBB