Sign in to follow this  
Followers 0

PHP emailer - landing in client spam?

2 posts in this topic

Hi all,

I thought I'd be smart and write a form page which would automatically construct an email to send to the specified client.



$emailto = $_POST['emailto'];
$emailfrom = $_POST['emailfrom'];
$subject = $_POST['subject'];
$name = $_POST['name'];
$date = $_POST['date'];
$time = $_POST['time'];
$location = $_POST['location'];
$maplink = $_POST['maplink'];

$screenername = $_POST['screenername'];
$room = $_POST['room'];
$yourname = $_POST['yourname'];

$headers = 'From: '.$emailfrom. "\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$body = $_POST['emailbody'];

mail($emailto, $subject, $body, $headers);
echo "<h3 style='font-size: 20px;'>Success.</h3>";
echo "<p>The email has been successfully sent.</p>";

the $emailfrom variable is typically set to one of three company domains, for example:

Company Name <>

Thing is they receive all the other emails just fine when I send it from that email address via outlook. The webserver its being sent from is a rackspace one.



Share this post

Link to post
Share on other sites

Does your server have a dedicated IP or a shared one? If it's a shared IP it may be on one of the mail blacklists due to spam, have you checked?

If the IP isn't on a blacklist, it's probably because you're sending "from" but from a different domain (e.g. and it doesn't have permission, two ways to correct this would be:

1. Send "from" ( being the domain actually sending the email), but add a "reply-to" header of

2. Sign the email with a domainkey: http://www.codinghor...rough-code.html

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.