Page 1 of 1

[Resolved]mail function new line

Posted: Thu Sep 15, 2011 4:16 pm
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

Re: mail function new line

Posted: Thu Sep 15, 2011 4:19 pm
by stefans
nevermind XD i had to use double quotes, anyway
if someone ever have the same problem,
you have to use " instead of '

Re: mail function new line

Posted: Fri Sep 16, 2011 12:20 am
by Jackolantern
Glad you figured it out! Can you mark this as [resolved] by editing the first post's title? :)