Yii2 SwiftMailer返回路径没有设置

时间:2016-10-13 13:48:07

标签: php yii2 swiftmailer

我正在使用Yii2 SwiftMailer扩展程序。

但是return-path我遇到了问题。 我设置了地址,但是在这个地址上没有收到电子邮件。 它来自发件人地址。

我的配置:

 $body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
 $body .= '<html xmlns="http://www.w3.org/1999/xhtml">';
 $body .= '<head>';
 $body .= '<meta http-equiv="Content-Type" content="text/html; charset="' . Yii::$app->charset . '" />';
 $body .= '<title></title>';
 $body .= '</head>';
 $body .= '<body>';
 $body .= 'Test Message';
 $body .= '</body>';
 $body .= '</html>';



Yii::$app->mailer->useTransport('system')->compose()
    ->setFrom(['example@some.com' => 'example.com'])
    ->setReturnPath('bounced@some.com')
    ->addHeader('Reply-To', 'bounced@some.com')
    ->setTo('example2@some.com')
    ->setSubject('TEST MESSAGE')
    ->setHtmlBody($body)
    ->send();

我尝试使用任何其他方式,但没有任何帮助我。

发送电子邮件中的标题

`Return-path: <example@some.com>
Envelope-to: example2@some.com
Delivery-date: Thu, 13 Oct 2016 17:42:28 +0300
Received: from some.com ([159.203.33.129])
by site.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256)
(Exim 4.84)
(envelope-from <example@some.com>)
id 1buhDH-0002DI-S0
for example2@some.com; Thu, 13 Oct 2016 17:42:27 +0300
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=site.com;     s=dkim;
h=Content-Transfer-Encoding:Content-Type:MIME-     Version:To:From:Subject:Date:Message-ID;   bh=TJEj83H/pPguf4pMS+4FcdmBzKkRiY+DeLg2oWD2/iQ=;
b=kA3lrgCRo3Wqr6ky6JVhytV6m/Qx1L3NXFybgPWxyBE5bEqqFGWgOEJQd5O5sppbDnfWB780Hz0FKA8OiiT3IrbzvohHzjRf5SD/IYFz6IaGaN9jwVTojo5jFfBv8t6lv9KprH6MFQEqKJ8bqKNGp3HYIW    lr6DXQAEAAl6CogqY=;
Received: from [178.74.217.102] (helo=[127.0.0.1])
by site.com with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256)
(Exim 4.84_2)
(envelope-from <example@some.com>)
id 1buhDG-0001i4-Su
for example2@some.com; Thu, 13 Oct 2016 10:42:27 -0400
Message-ID: <34cb7242e992226ad1d1f74b821c325f@swift.generated>
Date: Thu, 13 Oct 2016 10:42:25 -0400
Subject: TEST MESSAGE
From: "Example.com" <example@some.com>
To: example2@some.com
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable`

0 个答案:

没有答案