SirChick Posted September 14, 2008 Share Posted September 14, 2008 How do you send emails with a formatted layout like using < br > etc I have tried it, i did this but it didn't work: <?php // Send the email. $subject = "Welcome"; $headers = 'Activation'; $message = "Thank you for registering. To activate your account, please click on this link:"; $message = $message. "www.domain.com/activate.php?x=" .mysql_insert_id(). "&y=$EmailCode"; $message = $message. ". <br>Your username is $Username <br> Your password is $Password2 !"; mail($Email, $subject, $message, $headers); ?> The email just shows the < br > as text so it looks like this: <br>Your username is test <br> Your password is test ! Which is obviously a bit of a pain... so how is it done exactly? Quote Link to comment Share on other sites More sharing options...
peranha Posted September 14, 2008 Share Posted September 14, 2008 use \r\n will cause a line break. <?php // Send the email. $subject = "Welcome"; $headers = 'Activation'; $message = "Thank you for registering. To activate your account, please click on this link:"; $message = $message. "www.domain.com/activate.php?x=" .mysql_insert_id(). "&y=$EmailCode"; $message = $message. ". \r\nYour username is $Username \r\n Your password is $Password2 !"; mail($Email, $subject, $message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
SirChick Posted September 14, 2008 Author Share Posted September 14, 2008 use \r\n will cause a line break. <?php // Send the email. $subject = "Welcome"; $headers = 'Activation'; $message = "Thank you for registering. To activate your account, please click on this link:"; $message = $message. "www.domain.com/activate.php?x=" .mysql_insert_id(). "&y=$EmailCode"; $message = $message. ". \r\nYour username is $Username \r\n Your password is $Password2 !"; mail($Email, $subject, $message, $headers); ?> Thank you and also how do you make sure that the link to the activation page will be click able because some people report it just comes out as text which they have to copy and paste? Quote Link to comment Share on other sites More sharing options...
peranha Posted September 14, 2008 Share Posted September 14, 2008 try adding http:// in front of it do you know if it is a specific email server that is doing this, I havent had any problems, but I have http:// in front of mine. Quote Link to comment Share on other sites More sharing options...
SirChick Posted September 15, 2008 Author Share Posted September 15, 2008 hotmail is but gmail doesn't so its specific to email server of hotmail (to my knowledge). Quote Link to comment Share on other sites More sharing options...
peranha Posted September 15, 2008 Share Posted September 15, 2008 Add http:// in front of it, mine works fine in hotmail this is what I have. $message.="http://www.website.com/confirmation.php?passkey=$uniqueid \r\n"; Quote Link to comment Share on other sites More sharing options...
SirChick Posted September 15, 2008 Author Share Posted September 15, 2008 Ok thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.