0
有沒有人知道我如何讓phpmailer在上傳的網站上工作。上傳網站上的PHPmailer
include("class.phpmailer.php");
include("class.smtp.php");
$mail = new PHPMailer();
$body = "You have been added to the University of Portsmouth project
database. Your password is
'".$_POST['Password']."'
And your username is
'".$_POST['Username']."'
please click the link below, login to the website, select account settings and change
the password to become verified";
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tsl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 25; // set the SMTP port
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = ""; // GMAIL password
$mail->From = "[email protected]";
$mail->FromName = "Nathan Abiola";
$mail->Subject = "You have been added to the project database, this email is important";
$mail->AltBody = "Please click"; //Text Body
$mail->WordWrap = 50; // set word wrap
$mail->MsgHTML($body);
$mail->AddReplyTo("[email protected]","Webmaster");
$mail->AddAddress($_POST['Email'],"First Last");
$mail->IsHTML(true); // send as HTML
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
}
}
}
該代碼在離線狀態下工作,但是一旦我上載它,當我提交它時,出現以下錯誤。我是否缺少像你一樣的東西在線使用phpmailer。任何機構是否有任何潛在的替代品。感謝任何可能的幫助。
SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.
謝謝,現在要睡覺,但會盡量在早上和彙報。 –
在這方面有什麼進展? – McAfeeJ