Jump to content

HTML PHP EMAIL


benzetti82

Recommended Posts

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","info@mydomain.com");

$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( "info@mydomain.com", "MYDOMAIN.com Contact/Feedback", $completemessage, $headers);
header("Location: thankyou.php");
?>

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.