通过本地主机xampp发送电子邮件不适用于Outlook

时间:2019-02-06 21:33:05

标签: php email outlook xampp localhost

当有人填写表格时,我试图将电子邮件发送到我的hotmail帐户,但是我的电子邮件中没有任何显示。下面,我在xampp文件夹中附加了我的代码和相关文件。

这是我的sendmail.ini文件

smtp_server=smtp.live.com

; smtp port (normally 25)

smtp_port=25

auth_username=paperlesspub@hotmail.com
auth_password=xxxxxx

这是我的php.ini文件

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP= smtp.live.com
; http://php.net/smtp-port
smtp_port=465

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = paperlesspub@hotmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "C:\Xampp\sendmail\sendmail.exe -t"

这是我的php文件,其中包含表格

<?php
//if "email" variable is filled out, send email
  if (isset($_REQUEST['email']))  {
  
  //Email information
  $admin_email = "paperlesspub@hotmail.com";
  $email = $_REQUEST['email'];
  $subject = $_REQUEST['subject'];
  $comment = $_REQUEST['comment'];
  
  //send email
  mail($admin_email, "$subject", $comment, "From:" . $email);
  
  //Email response
  echo "Thank you for contacting us!";
  }
  
  //if "email" variable is not filled out, display the form
  else  {
?>

 <form method="post">

  Email: <input name="email" type="text" />

  Subject: <input name="subject" type="text" />

  Message:

  <textarea name="comment" rows="15" cols="40"></textarea>

  <input type="submit" value="Submit" />
  </form>
  
<?php
  }
?>

我是从本地主机发送电子邮件的新手,所以任何建议都将不胜感激,我已经在这里查找了答案,但是似乎没有一个问题与我的问题有关!

0 个答案:

没有答案