0

以下のコードがあり、次のエラーが発生しています。

バージョン PHPMailer_v5.1 を使用しています。別のバージョンを試しましたが、うまくいきませんでした。
何か案は?

SMTP エラー: 認証できませんでした

$mail = new PHPMailer(false); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Mailer = "smtp";
$mail->SMTPSecure = "ssl"; 
$mail->Host       = "smtp.easyname.eu"; // SMTP server
$mail->Port       = 465; 
$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Username   = "info@mydomain.net"; // SMTP account username
$mail->Password   = "*****";            // SMTP account password
$mail->AddReplyTo("$fromEmail", "$from");
$mail->AddAddress("$toEmail", "$toName");
$mail->SetFrom("$fromEmail", "$from");
$mail->Subject = "New enquiry to example (SUBJECT:'$subject')";
$mail->AltBody = "$message"; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML("$message");
$mail->Send();
if($settings['cc_sender'])
{
    $mail = new PHPMailer(false); // the true param means it will throw exceptions on errors, which we need to catch
    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->Mailer = "smtp";
    $mail->SMTPSecure = "ssl";
    $mail->Host       = "smtp.easyname.eu"; // SMTP server
    $mail->Port       = 465;
    $mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
    $mail->SMTPAuth   = true;                  // enable SMTP authentication
    $mail->Username   = "info@mydomain.net"; // SMTP account username
    $mail->Password   = "******";           // SMTP account password
    $mail->AddReplyTo("no-reply@mydaomain.net", "example Website");
    $mail->AddAddress("$fromEmail", "example Enquiry");
    $mail->SetFrom("info@mydomain.net", "example Enquiry");
    $mail->Subject = "Your enquiry from example (SUBJECT:'$subject')";
    $mail->AltBody = "$message"; // optional - MsgHTML will create an alternate automatically
    $mail->MsgHTML("$message");
    $mail->Send();
}
4

0 に答える 0