yoyo Posted July 19, 2007 Share Posted July 19, 2007 <?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 More sharing options...
aspnetguy Posted July 19, 2007 Share Posted July 19, 2007 the \n line breaks are not showing because those are text line breaks but you are sending the email as text/html. Change all \n to <br> and it should work fine Link to comment Share on other sites More sharing options...
justsomeguy Posted July 19, 2007 Share Posted July 19, 2007 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 More sharing options...
yoyo Posted July 20, 2007 Author Share Posted July 20, 2007 How would i go about putting the information into the html structure? Link to comment Share on other sites More sharing options...
jhecht Posted July 20, 2007 Share Posted July 20, 2007 $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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.