strange mail behavior ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ecourt
Forum Newbie
Posts: 11
Joined: Mon Oct 13, 2003 9:53 pm

strange mail behavior ??

Post by ecourt »

$message = "hi.\r\n";
$message .= "hi \r\n";
$message .= "hi \r\n";
$message .= "hi \r\n";
$message .= "hi \r\n";
$message .= "hi \r\n";

when I sent this ---

mail ($to,$subj,$message,$header)

in the email, I get :

hi hi hi hi hi hi

and I wanted

hi
hi
hi
hi
hi
hi


Why are my \r\n's not working ??

Thanks!
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Try using \n\r (not \r\n) or just \n
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

heredoc format might also help:

Code: Select all

$message =<<<END

hi
hi
hi
hi
hi
hi 
END;
Mac
ecourt
Forum Newbie
Posts: 11
Joined: Mon Oct 13, 2003 9:53 pm

Post by ecourt »

I figured it out, I had a header set for text/html.

When I changed it to text, it worked perfectly!

Thanks!!
ecourt
Forum Newbie
Posts: 11
Joined: Mon Oct 13, 2003 9:53 pm

Post by ecourt »

one more mail question --

is there a way to send a message to multiple users, but each user can only see their name (like a BCC) ??

Thanks!
Post Reply