MSwanson Posted January 14, 2007 Share Posted January 14, 2007 I'm having problems with the following code. If I don't use the HTML formatted email, it works without a problem, but if I try to, I get various errors. I'm sure it is a simple syntax error. Any help would be appreciated![code]$name = $_POST['first_name']; $email = $_POST['email']; $toaddress = '[email protected]'; // EMAIL TO INFO $fromaddress = $_POST['email']; $replyaddress = $_POST['email']; $subject = "FVCC Contact from {$_POST['first_name']} {$_POST['last_name']}"; //$content = $_POST['comments']; $content = '<html><head> <title>Website Contact</title></head><body><strong>Customer Information: </strong><br>{$_POST['first_name']} {$_POST['last_name']}{$_POST['address']}{$_POST['city'], {$_POST['state']} {$_POST['zip']}<br><strong>Email Address:</strong>{$_POST['email']}<br><strong>Comments:</strong>{wordwrap($_POST['comments'])}</body></html>';[/code] Link to comment https://forums.phpfreaks.com/topic/34134-mail-html-formatted-email/ Share on other sites More sharing options...
mattd8752 Posted January 14, 2007 Share Posted January 14, 2007 Where is this file hosted & what are the errors. Copy and paste them. Link to comment https://forums.phpfreaks.com/topic/34134-mail-html-formatted-email/#findComment-160549 Share on other sites More sharing options...
MSwanson Posted January 14, 2007 Author Share Posted January 14, 2007 The file is hosted on my webserver. Ther error currenty is:Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwroot\contact-us.php on line 117Everytime I try to fix something, I keep getting a new error... Link to comment https://forums.phpfreaks.com/topic/34134-mail-html-formatted-email/#findComment-160555 Share on other sites More sharing options...
ultrus Posted January 14, 2007 Share Posted January 14, 2007 I find the following class to be helpful when sending emails of all kinds. It saves me TONS of time:http://www.phpguru.org/static/mime.mail.html Link to comment https://forums.phpfreaks.com/topic/34134-mail-html-formatted-email/#findComment-160565 Share on other sites More sharing options...
mattd8752 Posted January 14, 2007 Share Posted January 14, 2007 My best guess would be that you are using " or ' which is interfering with the code. Try addslashes() and then on the final output (sending the code) stripslashes(). If you receive any further errors I am not sure, this is the only possibility I can think of IMO. GL Link to comment https://forums.phpfreaks.com/topic/34134-mail-html-formatted-email/#findComment-160567 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.