phpmailer通过自己的邮件服务器发送邮件,丢失DKIM

发布于 2025-01-29 10:36:01 字数 1497 浏览 4 评论 0原文

我正在使用phpmailer v 6.6.0 在Stackoverflow上,有很多提示和技巧,如何创建和使用以发送DKIM签名邮件的关键文件。

但是我的问题很简单。 我不记得用.key-file提供Thunderbird / Livemail / Outlook。

我要做的就是使用phpmailer通过我的邮件服务器发送邮件。像所有其他电子邮件程序一样。

到目前为止,这是我的代码:

    $Server = "xxxxxx.xxxxxx.com" ;
    $Username = "mxxxxx" ;
    $Password = "xxxxxxxxxxxx" ;
    
    $mail = new PHPMailer();
    $mail->isSendmail();
    // Define the sender
    $mail->Host = $Server; 
    $mail->Port = 587;
    $mail->SMTPAuth = true;
    $mail->Username = $Username; 
    $mail->Password = $Password; 
    $mail->Hostname = "@thisdomain.com";
    $mail->MessageID = "<".time()."@thisdomain.com>";
    $mail->XMailer="MyMailer";
    //Set who the message is to be sent from
    $mail->setFrom($dbset['Sender']);
    $mail->addReplyTo($dbset['Sender']);
    $mail->addAddress($dbset['Receiver']);
    $mail->Subject = "JUST A TEST";
    $mail->isHTML(false);
    $mail->Body = "This is just a test";
    //send the message, check for errors
    $Res = $mail->send(); 
    if (!$Res) die('VERY BAD - Error sending mail!');
    $mail->__destruct();
    unset($mail);

嗯,它的效果很好,在“ dkim-signature:v = 1; a = rsa-sha256; c = lessive/simple; d = gmx.net; s = badeba3b8450; t = 1652648844; bh = x8/d1v6jj+heucnmhbgz3hevzmggnikhaok ...这里很多字节...“

我在做什么错? 我不需要设置自己的邮件服务器。 我在提供商的邮件服务器的运作良好,包括DKIM签名。 为什么它不与phpmailer一起使用? 签署电子邮件不是客户端的工作,应该在邮件服务器上完成。 还是我错了?

无助 苹果

i'm using phpmailer V 6.6.0
Here at stackoverflow are a lot of hints and tricks, how to create and use key files for sending DKIM-signed mails.

But my problem is very simple.
I can't remember to provide Thunderbird / Livemail / Outlook whatever with a .key-file.

All i want to do is to use phpmailer sending a mail via my mail server. Like all other EMail-Programs do.

This is my code so far:

    $Server = "xxxxxx.xxxxxx.com" ;
    $Username = "mxxxxx" ;
    $Password = "xxxxxxxxxxxx" ;
    
    $mail = new PHPMailer();
    $mail->isSendmail();
    // Define the sender
    $mail->Host = $Server; 
    $mail->Port = 587;
    $mail->SMTPAuth = true;
    $mail->Username = $Username; 
    $mail->Password = $Password; 
    $mail->Hostname = "@thisdomain.com";
    $mail->MessageID = "<".time()."@thisdomain.com>";
    $mail->XMailer="MyMailer";
    //Set who the message is to be sent from
    $mail->setFrom($dbset['Sender']);
    $mail->addReplyTo($dbset['Sender']);
    $mail->addAddress($dbset['Receiver']);
    $mail->Subject = "JUST A TEST";
    $mail->isHTML(false);
    $mail->Body = "This is just a test";
    //send the message, check for errors
    $Res = $mail->send(); 
    if (!$Res) die('VERY BAD - Error sending mail!');
    $mail->__destruct();
    unset($mail);

Well it works great, beside of the "DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
s=badeba3b8450; t=1652648844;
bh=x8/D1v6jj+heUcnMHbgz3HeVzmgGNIkhaOk...lots of bytes here..."

What am i doing wrong?
I don't need to set up an own mail server.
My mail server at my provider works great, including the DKIM signature.
Why won't it work with phpmailer?
Signing the Email is not the job of the client, it should be done at the mail server.
Or i'm wrong at this?

Helpless
Mac

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文