【问题标题】:PHP - sending mail using xampp localhostPHP - 使用 xampp localhost 发送邮件
【发布时间】:2015-12-16 15:57:34
【问题描述】:

我正在尝试使用 xampp 发送到 gmail。

我的PHP版本是5.6.8

使用this source 作为指导, 我更改了 php.ini 和 sendmail.ini 的配置,但它对我不起作用。 页面始终显示失败:电子邮件未发送!

这是我的 php:

$to      = 'kennybanny12@gmail.com';
$subject = 'No subject';
$message = 'Hello, this is the content of the email.';
$headers = 'From: sticollegesocial@gmail.com';

if(mail($to, $subject, $message, $headers)) {
    echo 'Email sent successfully!';
} else {
    die('Failure: Email was not sent!');
}

这些是我在 php.ini 中更改的内容:

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = sticollegesocial@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

sendmail.ini:

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=sticollegesocial@gmail.com
auth_password=**********
force_sender=sticollegesocial@gmail.com

【问题讨论】:

标签: php email xampp


【解决方案1】:

看起来您尝试得很好,但该帖子不包含作者之类的内容。 please look into this link.这可能会对你有所帮助。

【讨论】:

猜你喜欢
  • 2015-01-05
  • 2012-05-07
  • 2013-07-15
  • 2012-01-21
  • 1970-01-01
  • 2012-12-15
  • 2012-10-19
  • 2013-04-06
相关资源
最近更新 更多