0
我的ISP已经开始要求SMTP身份验证,我似乎无法弄清楚如何将这些信息添加到我的头文件中。以下是我的代码的简化版本。任何帮助将非常感激。如何发送身份验证的PHP邮件
谢谢。
<?php
$content = 'Hello';
$content .= ' 123';
$headers = 'Content-Type: text/html; charset=UTF-8'."\r\n";
$headers .= 'From: ABC <[email protected]>';
// The four lines below need to be fixed.
$smtpinfo["host"] = "host.hostingcompany.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "username";
$smtpinfo["password"] = "password";
$sent = '[email protected]', 'A test email', $content, $headers);
$sent = '[email protected]', 'A test email', $content, $headers);
?>
这是唯一的方法吗?可以在不添加phpmailer的情况下完成吗?谢谢。 – user3495744
这是另一种方式... http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm – Latheesan