[Resolved]mail function new line

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
stefans
Posts: 48
Joined: Wed Sep 14, 2011 7:14 pm

[Resolved]mail function new line

Post by stefans »

Hello,
I haven't really worked that much with the mail function, but yeah i will need this,
as far as i remember \n is a new line right? but it doesn't work =s
so this is my code:

Code: Select all

$message = 'Hello player,\n\nYou registrated a new account on gamedev.comuf.com, click the link to activate!\nhttp://gamedev.comuf.com/activate.php?email='.$email.'&code='.$code;
should be right right? XD
but the mail just looks like this
Hello player,\n\nYou registrated a new account on gamedev.comuf.com, click the link to activate!\n-link =p-
why doesn't it make enters where i put \n?
this is the full code

Code: Select all

$to      = $email;
					$subject = 'Game Registration';
					$message = 'Hello player,\n\nYou registrated a new account on gamedev.comuf.com, click the link to activate!\nhttp://gamedev.comuf.com/activate.php?email='.$email.'&code='.$code;
					$header = 'From: noreply@gamedev.comuf.com';
					mail($to, $subject, $message, $header);
what do i do wrong?

Thanks,
Stefans
Last edited by stefans on Fri Sep 16, 2011 12:47 pm, edited 1 time in total.
Current project: http://www.mmtycoon.eu
stefans
Posts: 48
Joined: Wed Sep 14, 2011 7:14 pm

Re: mail function new line

Post by stefans »

nevermind XD i had to use double quotes, anyway
if someone ever have the same problem,
you have to use " instead of '
Current project: http://www.mmtycoon.eu
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: mail function new line

Post by Jackolantern »

Glad you figured it out! Can you mark this as [resolved] by editing the first post's title? :)
The indelible lord of tl;dr
Post Reply

Return to “Beginner Help and Support”