Jump to content

why arent my line breaks showing in my mail?


yoyo

Recommended Posts

<?php/* recipients */$to = "jamiewa2003@gmail.com" . ", " ; // note the comma$to .= "mail@dwyse.com";/* subject */$subject = "New Customer";$name = $_POST['name'];$phone = $_POST['phone'];$email_address = $_POST['email_address'];$reside = $_POST['reside'];/* message */$message = '<html><head><title>New customer details</title></head><body><table cellspacing="0" cellpadding="0" width="550"> <tr> <td style="color: #fff; background: #FFAA00; font-family: Helvetica, Arial, sans-serif;"> <h1>Potentual Customer</h1> </td> </tr> </table></body></html>';$message .= "Name: " . $name . "\n";$message .= "Phone Number: " . $phone . "\n";$message .= "Email: " . $email_address . "\n";$message .= "Reside: " . $reside . "\n";/* To send HTML mail, you can set the Content-type header. */$headers = "MIME-Version: 1.0\r\n";$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";/* and now mail it */mail($to, $subject, $message, $headers);?>Thanks

Link to comment
Share on other sites

And it would also be a good idea to put your content in the HTML part of the mail. You have $message building the entire HTML page, all the way to the end, and then you add on your own data after that. The information needs to in the HTML structure, not after it.

Link to comment
Share on other sites

$message = '<html><head><title>New customer details</title></head><body><table cellspacing="0" cellpadding="0" width="550"><tr><td style="color: #fff; background: #FFAA00; font-family: Helvetica, Arial, sans-serif;"><h1>Potentual Customer</h1></td></tr></table>Name: ". $name . "<br />Phone Number: " . $phone . "<br/>Email: " . $email_address . "<br/>Reside: " . $reside . "\n</body></html>';

Something like that should do...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...