Php 我们如何在服务器上设置google应用程序帐户集
我正试图通过谷歌应用程序从我的服务器发送邮件 我正在使用以下php代码:-Php 我们如何在服务器上设置google应用程序帐户集,php,smtp,Php,Smtp,我正试图通过谷歌应用程序从我的服务器发送邮件 我正在使用以下php代码:- $to = "username@gmail.com"; $header = "From: username@netvigator.com"; $subject = "testing mail"; $message = "no reply pls"; ini_set("SMTP","smtp.gmail.com"); ini_set("SMTP_PORT", 23); ini_set("sendmail_from","u
$to = "username@gmail.com";
$header = "From: username@netvigator.com";
$subject = "testing mail";
$message = "no reply pls";
ini_set("SMTP","smtp.gmail.com");
ini_set("SMTP_PORT", 23);
ini_set("sendmail_from","username@fullpiracy.com");
ini_set("auth_username","username@fullpiracy.com");
ini_set("auth_password","password");
mail($to, $subject, $message, $header);
提前谢谢 我相信Gmail使用SSL(或TLS),所以你应该相应地调整你的设置
ssl连接的端口通常为465,TLS的端口通常为587,地址为ssl://smtp.gmail.com
和tls://smtp.gmail.com
是指向有用的SO问题的链接,该问题可能会有所帮助。这是通过“发送邮件”开源库完成的