Jump to content

[SOLVED] formated emails


SirChick

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/124245-solved-formated-emails/
Share on other sites

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);
?>

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.