Jay
Jay

Reputation: 1104

PHP mail() not received for Outlook 2007

I have a contact form that I'm writing using jQuery and PHP. Below is the PHP bit, which works perfectly fine when I change the $youremail variable to my gmail account, but the emails are never received in my office Outlook account. Is there something I'm missing?

<?php

  // Email Vars
      $youremail = "my_email@on_outlook2007.com";
      $headers = "From: $name <$email>\n";
      $subject =  "Subject Line Here";
      $ip = $_SERVER['REMOTE_ADDR']; 
      $message_clean = html_entity_decode(stripslashes($message));

  // Format Email
      $email_format_cc =    $message_clean . "\n\n" . "___________________________________________________________________________" . "\n\n" . 
                          "Name: " . $name . "\n" .
                          "Company: " . $company . "\n" .
                          "IP Address: " . $ip . "\n" .
                          "Sent: " . $timestamp;
      $email_format    =  $email_format_cc . "\n" . 
                          "Page: " . $from_url;

      mail($youremail, $subject, $email_format, $headers);

?>

Upvotes: 0

Views: 910

Answers (1)

Marc B
Marc B

Reputation: 360872

Check your server's mail log to see if/why gmail is bouncing the mail. PHP's mail() function is extraordinarily stupid and claims success even as the universe explodes around it.

Upvotes: 1

Related Questions