XAMPP邮件不能使用PHP mail()函数 [英] XAMPP mail not working with PHP mail() function

查看:118
本文介绍了XAMPP邮件不能使用PHP mail()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了XAMPP,Apache正在运行,MySQL和Mercury也是这样。



在Dreamweaver中,我创建了一个带有邮件的php文件$ to,$ subject,$ msg,'From:'。$ email); 函数,但是当我从localhost运行文件时显示错误。在使用xampp控制面板播放后,打开和关闭汞,它没有显示任何错误,但是还没有发送电子邮件...任何想法?



管理员按钮在cp的汞没有什么。



谢谢!
R

解决方案

你必须要配置与xampp捆绑的汞服务器来实际传递/传递邮件。



但是我建议您使用 SwiftMailer ,而不是使用php mail()函数。



编辑:有第三个选项。 php / win32内置的mini-smtp-client无法进行身份验证。所以你不能简单地把 SMTP = mail.gmail.com;您的php.ini中的smtp_port = 25 但是您可以设置 sendmail_path ,并指向可以中继的应用程序消息到另一个smtp服务器(包括身份验证),例如假发邮件

(但我仍然建议swiftmailer)


I just installed XAMPP, Apache is running, so is MySQL and Mercury.

In Dreamweaver I created a php file with a mail($to,$subject,$msg,'From:'.$email); function, but when I ran the file from localhost it showed an error. After playing around with xampp control panel, turning mercury on and off, it's not showing any errors, yet is not send the email either... any ideas?

the 'admin' button on the cp for mercury does nothing.

Thanks! R

解决方案

You would have to configure the mercury server bundled with xampp to actually deliver/relay the mails.

But I suggest you use something like SwiftMailer instead of php's mail() function.

edit: there is a third option. The mini-smtp-client built into php/win32 can't do authentication. Therefore you can't simply put SMTP=mail.gmail.com; smtp_port=25 in your php.ini. But you can set sendmail_path and point to an application that can relay the message to another smtp server (including authentication), e.g. fake sendmail.
(But I still suggest swiftmailer)

这篇关于XAMPP邮件不能使用PHP mail()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆