Ich weiß, dass diese Frage schon einmal gestellt wurde und ich habe alle Vorschläge implementiert, die ich ohne Erfolg finden konnte. Bevor ich auf PHPmailer gebe und die kryptische PHP-Mail benutze, die funktioniert, dachte ich, dass irgendwo auf der Welt vielleicht eine Lösung existiert.PHPmailer sendet keine E-Mails und gibt keine Fehler aus
PHP
<?php
require_once 'class.phpmailer.php';
function sendEmail($subject, $body, $toEmail, $fromEmail, $fromName = 'N/A', $isHTML=false, $msg="Thank you for contacting us. Your message has been sent.")
{
try
{
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->Host = 'mail.privateemail.com';
$mail->Port = '465';
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'MYPWD';
$mail->SMTPSecure = "ssl";
$mail->From = $fromEmail;
$mail->FromName = $fromName;
$mail->Subject = $subject;
if ($isHTML) $mail->IsHTML(true);
$mail->Body = $body;
$mail->AddAddress($toEmail);
$result = $mail->Send() ? 1 : 0;
if (count($msg)) echo $msg;
return $result;
} catch (phpmailerException $e) {
return $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
return $e->getMessage(); //Boring error messages from anything else!
}
}
?>
in class.phpmailer.php Klasse ist '$ mail-> From' und' $ mail-> FromName' sind separate Funktionen oder gleich wie diese $ this-> mail-> SetFrom ($ from_email, $ from_name); '? –
Danke für Ihren Kommentar. Können sie nicht wie ich getrennt gesetzt werden? –
Möglicherweise müssen Sie in DKIM (DomainKeys Identified Mail) suchen. Ihre E-Mail-Adresse wird möglicherweise gesendet, dann aber herausgefiltert. Haben Sie Ihr DKIM bereits eingerichtet? – Makketronix