I'm having trouble with sending an email through a form and formatting it with html. It's just a simple form. I get the email but the tags are in the email instead of it being formatted. Thanks.... <?php $name=$_POST['name']; $work=$_POST['work']; $toaddress = 'xxx@xxx.com'; $subject = 'test'; $message =' <head> <title>Untitled Document</title> </head> <body> My name is '.$name.' and I do '.$work.' in my feild. </body> '; $fromaddress ='From: '; $headers='MIME-Version: 1.0'."\r\n"; $headers.='Content-Type: text/html; charset=iso-8859-1'."\r\n"; mail($toaddress, $subject, $message, $fromaddress, $headers); ?>
I just figured it out, I had 5 parameters in the mail function instead of 4 <?php $name=$_POST['name']; $work=$_POST['work']; $toaddress = 'xxx@xx.com'; $subject = 'test'; $message =' <head> <title>Untitled Document</title> </head> <body> My name is '.$name.' and I do '.$work.' in my feild. </body> '; $headers='MIME-Version: 1.0'."\r\n"; $headers.='Content-Type: text/html; charset=iso-8859-1'."\r\n"; $headers.="From: <xxx@xx.com>". "\r\n"; mail($toaddress, $subject, $message, $headers); ?>