我是 php 新手,设置时我的 php 邮件程序有问题
$Host = 'ssl://smtp.googlemail.com';
$Username = 'my gamil id';
$Password = 'my gmail password';
$Port = 465;
Php mailer 工作正常,但是当我将其更改为
$Host = 'ssl://smtp.googlemail.com';
$Username = 'client gamil id';
$Password = 'client gmail password';
$Port = 465;
邮件程序不工作,并显示错误消息
需要身份验证
我来自印度,客户来自美国,那么配置文件有什么变化吗?请帮我
这是我的 mailer.php 文件
include 'phpmailer/class.config.php';
include 'phpmailer/class.phpmailer.php';
include 'phpmailer/class.smtp.php';
session_start();
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->IsHTML();
$mail->SMTPAuth = true;
if (MailConfig::$Debug) {
$mail->Host = MailConfig::$DebugHost;
$mail->Username = MailConfig::$DebugUsername;
$mail->Password = MailConfig::$DebugPassword;
} else {
$mail->Host = MailConfig::$Host;
$mail->Username = MailConfig::$Username;
$mail->Password = MailConfig::$Password;
}
$Subject = "Payment Received";
//////
/////////////
if (MailConfig::$Debug)
$receipientEmail = "client@example.com";
else
$receipientEmail = "client@example.com";
$Body = "A payment of $ " . $_POST['payment'] . " has been credited in your account";
$mail->AddAddress($receipientEmail);
$mail->Subject = $Subject;
$mail->Body = $Body;
谢谢