Jump to content

emails from my contact form are being sent to my spam folder in outlook


djjamiegee

Recommended Posts

hi i am still ne to php and still trying to get me head around some things :)

 

i have a simple contact form on my site but when someone fills it in the email is sent to my inbox on my webmail from my server but when i opening it in outlook 2007 it is in my spam folder, i have added some header within the php does anyone know why????

 

heres the code

 

<?php
ini_set("sendmail_from", "[email protected]");

$email_to = "[email protected], [email protected]";
$name =$_POST['name'];
$email_from =$_POST['email'];
$email =$_POST['email'];
$phone =$_POST['phone'];
$solution =$_POST['solution'];
$budget =$_POST['budget'];
$currentsite =$_POST['currentsite'];
$comments = $_POST['comments'];
$email_subject = "Contact Form";

$headers =
"From: $email_from .\n";
"Reply-To: $email_from .\n";
"MIME-Version: 1.0 \r\n" ; 
"Content-Type: text/plain \r\n"; 
"Return-Path: $from\n"; 
"X-Mailler: PHP v" . phpversion() . "\n"; 
"Content-type: text/html; charset=iso-8859-1\r\n"; 


$message= "Name: " . $name . "\nEmail: " . $email . "\nPhone: " . $phone ."\nSolution: " . $solution ."\nBudget: " . $budget ."\nCurrentSite: " . $currentsite ."\nComments: " . $comments;

$sent = mail($email_to, $email_subject, $message, $headers, '[email protected]');
if ($sent)
{
header( "Location: http://www.designtwenty1.com" );
} else {
echo 'There has been an error sending your comments. Please try later.';
}

?>

 

many thanks in advance

 

jamie

Do you have webmail access for your designtwenty1.com account?

 

If so does the message end up in the spam folder there as well or are there particular rules you have in place in Outlook that are defining the message as spam.

 

There are plenty of things you can do to validate an email but not a whole lot when sending via php on linux.  Just be sure your hostname is valid on the server in that it resolves and you have a proper reverse DNS record.

 

If you were sending via SMTP you could also include domain key validation.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.