0

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);

?>
4

1 回答 1

1

检查您服务器的邮件日志以查看 gmail 是否/为什么会退回邮件。PHP 的mail()函数非常愚蠢,即使宇宙在它周围爆炸,它也声称成功。

于 2011-07-28T20:37:35.733 回答