benzetti82 Posted March 30, 2010 Share Posted March 30, 2010 So I was trying to change up my script to dress it up a bit but it's not working... I am still kind of new to PHP... Any ideas? <?php ini_set("SMTP","relay-hosting.securesever.net"); ini_set("sendmail_from","[email protected]"); $headers = "From: " . strip_tags($_POST['req-email']) . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $completemessage = '<html><body>'; $completemessage .= '<table rules="all" style="border-color: #666;" cellpadding="10">'; $completemessage .= "<tr style='background: #eee;'><td><strong>First Name:</strong> </td><td>" . strip_tags($_REQUEST['firstname']) . "</td></tr>"; $completemessage .= "<tr><td><strong>Last Name:</strong> </td><td>" . strip_tags($_REQUEST['lastname']) . "</td></tr>"; $completemessage .= "<tr style='background: #eee;'><td><strong>Phone:</strong> </td><td>" . strip_tags($_REQUEST['phone']) . "</td></tr>"; $completemessage .= "<tr><td><strong>Email:</strong> </td><td>" . strip_tags($_REQUEST['email']) . "</td></tr>"; $completemessage .= "<tr style='background: #eee;'><td><strong>Message:</strong> </td><td>" . strip_tags($_REQUEST['message']) . "</td></tr>"; $completemessage .= "</table>"; $completemessage .= "</body></html>"; mail( "[email protected]", "MYDOMAIN.com Contact/Feedback", $completemessage, $headers); header("Location: thankyou.php"); ?> Link to comment https://forums.phpfreaks.com/topic/196928-html-php-email/ Share on other sites More sharing options...
MatthewJ Posted March 30, 2010 Share Posted March 30, 2010 Maybe thies isn't supposed to be securesever but secureserver instead? ini_set("SMTP","relay-hosting.securesever.net"); Link to comment https://forums.phpfreaks.com/topic/196928-html-php-email/#findComment-1033877 Share on other sites More sharing options...
o3d Posted March 30, 2010 Share Posted March 30, 2010 First off, are there any errors? Secondly check that your mail function returns with a true value. if (mail(...)) { header("Location: thankyou.php"); } else { echo 'could not send mail...<br />'; } Link to comment https://forums.phpfreaks.com/topic/196928-html-php-email/#findComment-1033878 Share on other sites More sharing options...
benzetti82 Posted March 30, 2010 Author Share Posted March 30, 2010 Oh sorry the form works. Its just the CSS styles aren't displaying as they should... Is this a limitation of CSS with email programs such as outlook? Also how would I code it so that the FROM in my email shows the actual persons email address? Link to comment https://forums.phpfreaks.com/topic/196928-html-php-email/#findComment-1033880 Share on other sites More sharing options...
benzetti82 Posted March 30, 2010 Author Share Posted March 30, 2010 Ok duh I screwed something up on my end... The only other issue I am having is that I can't get the FROM to correctly display the submitters email... Link to comment https://forums.phpfreaks.com/topic/196928-html-php-email/#findComment-1033887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.