アップロードされた Web サイトで 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 = "projectnateabiola@gmail.com"; // GMAIL username
$mail->Password = ""; // GMAIL password
$mail->From = "projectnateabiola@gmail.com";
$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("projectnateabiola@gmail.com","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.