homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Emailing to Exchange Server Problem
My emails aren't going through to a Windows exchange sever

 11:55 pm on Nov 1, 2008 (gmt 0)

I'm still pretty new to PHP and am having problems with my email script. My form will successfully send mail to my Comcast, Hotmail, Yahoo, and a couple other email accounts, but my work email which is on a Windows exchange server isn't receiving anything. Can someone please help me? Here's the PHP code I've been working with:

$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$to = $_POST['to'];
$message = $_POST['message'];
$submit = $_POST['submit'];

// Check if the form has been submitted.
if (isset ($submit)) {

$problem = FALSE; // No problems so far.

// Check each value.
if (empty ($name)) {
$problem = TRUE;
print '<div class="form_error">Error: Please enter your name.</div>';

if (empty ($email)) {
$problem = TRUE;
print '<div class="form_error">Error: Please enter your email address.</div>';

if (empty ($message)) {
$problem = TRUE;
print '<div class="form_error">Error: Please enter your message.</div>';

if (!$problem) { // If there weren't any problems...
print '<div class="form_success">Thanks for contacting us! Someone will get back to you shortly.</div><br />';

// Send the email.
$body = $name . "\n" . $email . "\n" . $phone . "\n\n" . $message;

mail ($to, 'Message from AEID Website', $body, 'From: ' . $name);

} else { // Forgot a field.

print '<br />';





 12:48 pm on Nov 2, 2008 (gmt 0)

my guess is it is getting seen as spam. You should check the folder that your spam is sent to and see if it's there.

The easy way to fix this is to whitelist the address it is coming from.

The real way to fix it is to properly construct the headers of the email to set enough values so your mail server doesn't think it's spam. The things to do could be much longer than that too because this can also rely on mail server settings on both sides of this communication as well.

looking to see if the message was sent to spam is the first step. Then look at the actual headers on the message you received is next.


 6:18 pm on Nov 2, 2008 (gmt 0)

That was my thought too, but both my spam and my junk email folders are empty.

I contacted a programmer friend of mine at the same time I posted this thread and he told me the same thing, that I'm missing headers. He also pointed out that the script I'm using is very dangerous in that it will allow tons of spam to come through, so he suggested abandoning this script and finding a fully-developed script somewhere else. I don't fully understand how my script could be abused like that, but I trust him and am going to take his advice. Thank you for your help and advice though, jatar_k!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved