我们如何使用 wamp 从本地主机发送 php(核心 php)邮件


How we send mail in php (core php) from localhost using wamp

我想从任何实时邮箱(Google.yahoo等)中的本地主机发送邮件。我在窗口环境中并使用 wamp。请帮助我。谢谢

你不能没有库。利用PHPMailer

如何在WAMP上配置PHPMailer。请参阅this

您可以使用sendmail和对于 wamp 本地主机,您可以在 php.ini 文件中进行一些更改,如

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = yourmail@gmail.com
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
//just remove semicolon
sendmail_path ="C:'wamp'sendmail'sendmail.exe -t -i"

现在重新启动你的阿帕奇