iT邦幫忙

1

*已解決*phpmailer 寄密碼重設驗證信被gmail歸為垃圾信

已解決
我用Gmail的撰寫工具寄出了一封email內有一個連結
發現他的連結html為

<div dir="ltr">
	<a href="www.google.com">		
        google
    </a>
</div>

這樣的格式

然後我剛剛把PHP改寫成

$mail->Body    = "<h1>密碼重設確認信</h1>
<p>使用者您好:<br><br>
我們收到您重設密碼的申請<br><br>
您的密碼重設連結如下:(有效時間為10分鐘)<br>
<div dir=\"ltr\">
    <a href='".base_url()."auth/reset_password/".$randomString."'>
       ".base_url()."auth/reset_password/".$randomString."
    </a>
</div>
<br>
<hr>
若您未申請密碼重設,請直接忽略此信 <br><br>
*此信為系統自動寄出,請勿直接回覆*
</p>";

就沒被擋信了......


原問題

使用phpmailer 寄出密碼重設驗證信件
全部都被Gmail歸類為垃圾信或疑似垃圾信

使用帳號為Gmail帳號 例:example@gmail.com

php程式碼如下

require 'application/third_party/PHPMailer/src/Exception.php';
require 'application/third_party/PHPMailer/src/PHPMailer.php';
require 'application/third_party/PHPMailer/src/SMTP.php';

$mail = new PHPMailer(true);

try {
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->Host = 'ssl://smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'example@gmail.com';
$mail->Password = '*********';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 465;
$mail->Charset	  = 'UTF-8';

$mail->setFrom('example@gmail.com', "=?utf-8?B?" . base64_encode("密碼重設確認信 - 活動名稱") . "?=");
$mail->addAddress($_POST['email']);
$mail->addReplyTo('example@gmail.com', "=?utf-8?B?" . base64_encode("活動名稱") . "?=");
				
$mail->isHTML(true);
$mail->Subject = "=?utf-8?B?" . base64_encode("密碼重設確認信 - 活動名稱") . "?=";
$mail->Body    = "<h1>密碼重設確認信 - 活動名稱</h1>
	<p>使用者您好:<br><br>
		我們收到您重設密碼的申請<br><br>
		您的密碼重設連結如下:(有效時間為10分鐘)<br>
    	<a href='".base_url()."auth/reset_password/".$token."'>
			".base_url()."auth/reset_password/".$token."
    	</a><br>
   		<hr>
    	若您未申請密碼重設,請直接忽略此信 <br><br>				    
    	活動名稱<br><br>			    
    	*此信為系統自動寄出,請勿直接回覆*
	</p>";
$mail->AltBody = '密碼重設確認信 - 活動名稱  您申請系統密碼重設連結如下:(有效時間為10分鐘)  '
	.base_url()."auth/reset_password/".$token
	.'若您未申請密碼重設,請直接忽略此信  活動名稱  *此信為系統自動寄出,請勿直接回覆*';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}

目前實測將

<a href='".base_url()."auth/reset_password/".$token."'>
	".base_url()."auth/reset_password/".$token."
</a>

拿掉就不會被歸類為垃圾信
請問應該要如何放置連結才不會被歸類為垃圾信?

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

2
Ray
iT邦大神 1 級 ‧ 2020-03-26 11:04:15
最佳解答

這個問題, 從 2013 年開始就有人在 Google 開發論壇上抱怨, 一直到 2020 年 2 月都還有新的抱怨出現......

由於 Google 不公開他的 Spam 攔檢條件, 也不允許用戶調整, 更不提供 Log 診斷, 而且不回應開發者的求救, 你只能...

不要用 Gmail 當你的轉信主機!!
寄得過只是運氣, 寄不過才是正常...

如果你選用其他第三方大量寄信服務, 例如:
MailChimp
MailGun
AWS SES
ymlp
...
都不會有這種問題.

目前各大 Email 託管服務 (Gmail, G Suite, O365, Outlook.com....等), 都有逼迫開發者改用上述大量郵件服務, 並嚴管 Spam 條件的傾向, 特別是採用 AI 技術來判定 Spam 之後, 規則就變得很模糊不清, 無法給你明確的解法.

畢竟, 託管用戶的消費利益才是它們要優先考量的, 不讓他們收到垃圾信 vs 把你判定成垃圾信, 兩者相比, 顯然前者重要很多, 後者就管你去死....

所以請接受網路現實, 不要為了貪圖方便或免費, 就偷懶用原本的郵件託管來寄信, 這樣只會浪費你的開發時間還查不出問題, 乖乖去申請大量寄信服務, 用 API 串起來....不然, 你就自架 Email Server, 只是要自己去對抗 IP 黑名單問題...

Franky Chen iT邦研究生 3 級 ‧ 2020-03-26 11:15:33 檢舉

感謝大大回答

我剛剛用Gmail的撰寫工具寄出了一封email內有一個連結
發現他的連結html為

<div dir="ltr">
	<a href="www.google.com">		
        google
    </a>
</div>

這樣的格式

然後我剛剛把PHP改寫成

$mail->Body    = "<h1>密碼重設確認信</h1>
<p>使用者您好:<br><br>
我們收到您重設密碼的申請<br><br>
您的密碼重設連結如下:(有效時間為10分鐘)<br>
<div dir=\"ltr\">
    <a href='".base_url()."auth/reset_password/".$randomString."'>
       ".base_url()."auth/reset_password/".$randomString."
    </a>
</div>
<br>
<hr>
若您未申請密碼重設,請直接忽略此信 <br><br>
*此信為系統自動寄出,請勿直接回覆*
</p>";

就沒被擋信了......

1
黃彥儒
iT邦高手 1 級 ‧ 2020-03-26 10:45:02

搞錯地方啦~

  • SPF
  • DKIM
  • DMARC

讀讀這篇文章:https://kinsta.com/blog/email-authentication/?utm_campaign=fbboost&utm_medium=cpc&utm_source=facebook&utm_content=email-authentication

看更多先前的回應...收起先前的回應...
Franky Chen iT邦研究生 3 級 ‧ 2020-03-26 10:46:41 檢舉

可是我是用GMAIL發出的
應該不會有

SPF
DKIM
DMARC

的問題吧......

Franky Chen iT邦研究生 3 級 ‧ 2020-03-26 10:49:44 檢舉

https://ithelp.ithome.com.tw/upload/images/20200326/2010239551H48XZl8v.png

黃彥儒 iT邦高手 1 級 ‧ 2020-03-26 10:52:43 檢舉

寄到這個網站,把報告貼出來
https://www.appmaildev.com/hk/dkim

Franky Chen iT邦研究生 3 級 ‧ 2020-03-26 10:56:34 檢舉
============================================================================
This is SPF/DKIM/DMARC/RBL report generated by a test tool provided 
	by AdminSystem Software Limited.

Any problem, please contact support@emailarchitect.net
============================================================================
Report-Id: 0b29286d
Sender: <*****email address *******@gmail.com>
Header-From: <*****email address *******@gmail.com>
HELO-Domain: mail-pg1-f196.google.com
Source-IP: 209.85.215.196
SSL/TLS: TLS secured
Validator-Version: 1.09
============================================================================
Original email header:

x-sender: *****email address *******@gmail.com
x-receiver: test-0b29286d@appmaildev.com
Received: from mail-pg1-f196.google.com ([209.85.215.196]) by appmaildev.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384);
	 Thu, 26 Mar 2020 02:54:10 +0000
Received: by mail-pg1-f196.google.com with SMTP id d17so2164300pgo.0
        for <test-0b29286d@appmaildev.com>; Wed, 25 Mar 2020 19:54:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:to:from:reply-to:subject:message-id:mime-version
         :content-transfer-encoding;
        bh=f4K97XNKsUiB26UotviTTVVweoWbCaqTM0QDTnyJQWU=;
        b=ZCIcF0FB6+mvmp9c3vhkWp2A4JGK2dvQje9zERX1DKhd1KimaGLgOO+lMkCdf0/Qgh
         Sjwfky334/VOZyUskyw+VYNpyRcMk0YsixduBCGBfePesptYuWt7HuleYvXHAiXdC734
         dS+STph/p812rBKd/x+ydkI1OP/qRiDHfMqABkgDrH871kVmaDt1vr7hz8Emvx0J8BGT
         su5j/Zo6Bo9tCXCvmrruPzPCM9EmRoB1qQUhmSwlI6qvBp+DJAn6d8GJk7FG6EyziXrZ
         jGXix8oJcdyrLrYS3gc1Oq5PxMm8bf+Zi+4zzzgaLa0Ws3e6oyQIxn/p9kXAwWsFtRLW
         HvAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:to:from:reply-to:subject:message-id
         :mime-version:content-transfer-encoding;
        bh=f4K97XNKsUiB26UotviTTVVweoWbCaqTM0QDTnyJQWU=;
        b=Iq3LvXZWDivohmxG/8l8wzNbXUqa4J3YbL0EX9I3ESxorvqRAdY2pFycg6vDP30xd1
         asvPO/XAsxhsXH+389j2mtTlktf3n8IGhuVt099ydNL19y4mnIlQidigjEljlmKHpq8q
         FVk6BY+aC6+qzENMR8DHD8Y+Yu2rpn0sZoNH8MDcIpOjRTs9SYdICyuNynePmFdK/6TF
         7IZ/pWvHlk7Qu4saNyvnU1RVJ0KBGKp06h4HpHXFPHAcztXGJcxefmEKt5PD0EFoioDG
         Fn9WAt52NOiLPzIh2u+YrJcB2ppg04vkLjkkH5k/LGl9ndFmJYyNfwiyfJ4XgA3y1+vB
         pcrA==
X-Gm-Message-State: ANhLgQ3W2RUN2B/DEqD75ljyFNWWM4tC6Fqt/oo9Mm0aO5/pFKZlAP+h
	4V2Uie704qvH7RQsymGWAEDfhE0y
X-Google-Smtp-Source: ADFU+vug+XoM44BS3nD1fFPhcwXUkhYDZTRCg+QnQ9dlwKZ6LccXJmW5RRrOSfwA2xOJpvzkRGF/oA==
X-Received: by 2002:a62:a116:: with SMTP id b22mr6945738pff.122.1585191248316;
        Wed, 25 Mar 2020 19:54:08 -0700 (PDT)
Return-Path: <*****email address *******@gmail.com>
Received: from testlab.frankystudio.cf (220-135-172-244.HINET-IP.hinet.net. [220.135.172.244])
        by smtp.gmail.com with ESMTPSA id 26sm428775pfp.130.2020.03.25.19.54.07
        for <test-0b29286d@appmaildev.com>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 25 Mar 2020 19:54:07 -0700 (PDT)
Date: Thu, 26 Mar 2020 02:54:06 +0000
To: test-0b29286d@appmaildev.com
From: =?utf-8?B?5Y+w54Gj6Z2S5bm06buR5a6i5p2+IEhhY2thdGhvbiBUYWl3YW4gSnIu?= <*****email address *******@gmail.com>
Reply-To: =?utf-8?B?5Y+w54Gj6Z2S5bm06buR5a6i5p2+IEhhY2thdGhvbiBUYWl3YW4gSnIu?= <*****email address *******@gmail.com>
Subject: =?utf-8?B?5a+G56K86YeN6Kit56K66KqN5L+hIC0g5Y+w54Gj6Z2S5bm06buR5a6i5p2+?=
Message-ID: <GaszbDyrFUDYUaIS4x1l0iMHUq2emazF882ycQeIwA@testlab.frankystudio.cf>
X-Mailer: PHPMailer 6.1.5 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-OriginalArrivalTime: 26 Mar 2020 02:54:10.0026 (UTC) FILETIME=[D2D52CA0:01D60319]

============================================================================
SPF: Pass
============================================================================

SPF-Record: v=spf1 redirect=_spf.google.com
Sender-IP: 209.85.215.196
Sender-Domain-Helo-Domain: gmail.com

Query TEXT record from DNS server for: gmail.com
[TXT]: v=spf1 redirect=_spf.google.com
[TXT]: globalsign-smime-dv=CDYX+XFHUw2wml6/Gb8+59BsH31KzUr6c1l2BPvqKX8=
Parsing SPF record: v=spf1 redirect=_spf.google.com

Mechanisms: v=spf1

Mechanisms: redirect=_spf.google.com
Testing mechanism redirect=_spf.google.com
Query TEXT record from DNS server for: _spf.google.com
[TXT]: v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all
Parsing SPF record: v=spf1 include:_netblocks.google.com include:_netblocks2.google.com include:_netblocks3.google.com ~all

Mechanisms: v=spf1

Mechanisms: include:_netblocks.google.com
Testing mechanism include:_netblocks.google.com
Query TEXT record from DNS server for: _netblocks.google.com
[TXT]: v=spf1 ip4:35.190.247.0/24 ip4:64.233.160.0/19 ip4:66.102.0.0/20 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:74.125.0.0/16 ip4:108.177.8.0/21 ip4:173.194.0.0/16 ip4:209.85.128.0/17 ip4:216.58.192.0/19 ip4:216.239.32.0/19 ~all
Parsing SPF record: v=spf1 ip4:35.190.247.0/24 ip4:64.233.160.0/19 ip4:66.102.0.0/20 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:74.125.0.0/16 ip4:108.177.8.0/21 ip4:173.194.0.0/16 ip4:209.85.128.0/17 ip4:216.58.192.0/19 ip4:216.239.32.0/19 ~all

Mechanisms: v=spf1

Mechanisms: ip4:35.190.247.0/24
Testing mechanism ip4:35.190.247.0/24
Testing CIDR: source=209.85.215.196;  35.190.247.0/24

Mechanisms: ip4:64.233.160.0/19
Testing mechanism ip4:64.233.160.0/19
Testing CIDR: source=209.85.215.196;  64.233.160.0/19

Mechanisms: ip4:66.102.0.0/20
Testing mechanism ip4:66.102.0.0/20
Testing CIDR: source=209.85.215.196;  66.102.0.0/20

Mechanisms: ip4:66.249.80.0/20
Testing mechanism ip4:66.249.80.0/20
Testing CIDR: source=209.85.215.196;  66.249.80.0/20

Mechanisms: ip4:72.14.192.0/18
Testing mechanism ip4:72.14.192.0/18
Testing CIDR: source=209.85.215.196;  72.14.192.0/18

Mechanisms: ip4:74.125.0.0/16
Testing mechanism ip4:74.125.0.0/16
Testing CIDR: source=209.85.215.196;  74.125.0.0/16

Mechanisms: ip4:108.177.8.0/21
Testing mechanism ip4:108.177.8.0/21
Testing CIDR: source=209.85.215.196;  108.177.8.0/21

Mechanisms: ip4:173.194.0.0/16
Testing mechanism ip4:173.194.0.0/16
Testing CIDR: source=209.85.215.196;  173.194.0.0/16

Mechanisms: ip4:209.85.128.0/17
Testing mechanism ip4:209.85.128.0/17
Testing CIDR: source=209.85.215.196;  209.85.128.0/17
ip4:209.85.128.0/17 hit, Qualifier: +
include:_netblocks.google.com hit, Qualifier: +

============================================================================
DKIM: pass
============================================================================

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:to:from:reply-to:subject:message-id:mime-version
         :content-transfer-encoding;
        bh=f4K97XNKsUiB26UotviTTVVweoWbCaqTM0QDTnyJQWU=;
        b=ZCIcF0FB6+mvmp9c3vhkWp2A4JGK2dvQje9zERX1DKhd1KimaGLgOO+lMkCdf0/Qgh
         Sjwfky334/VOZyUskyw+VYNpyRcMk0YsixduBCGBfePesptYuWt7HuleYvXHAiXdC734
         dS+STph/p812rBKd/x+ydkI1OP/qRiDHfMqABkgDrH871kVmaDt1vr7hz8Emvx0J8BGT
         su5j/Zo6Bo9tCXCvmrruPzPCM9EmRoB1qQUhmSwlI6qvBp+DJAn6d8GJk7FG6EyziXrZ
         jGXix8oJcdyrLrYS3gc1Oq5PxMm8bf+Zi+4zzzgaLa0Ws3e6oyQIxn/p9kXAwWsFtRLW
         HvAg==
Signed-by: *****email address *******@gmail.com
Expected-Body-Hash: f4K97XNKsUiB26UotviTTVVweoWbCaqTM0QDTnyJQWU=
Public-Key: k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAviPGBk4ZB64UfSqWyAicdR7lodhytae+EYRQVtKDhM+1mXjEqRtP/pDT3sBhazkmA48n2k5NJUyMEoO8nc2r6sUA+/Dom5jRBZp6qDKJOwjJ5R/OpHamlRG+YRJQqRtqEgSiJWG7h7efGYWmh4URhFM9k9+rmG/CwCgwx7Et+c8OMlngaLl04/bPmfpjdEyLWyNimk761CX6KymzYiRDNz1MOJOJ7OzFaS4PFbVLn0m5mf0HVNtBpPwWuCNvaFVflUYxEyblbB6h/oWOPGbzoSgtRA47SHV53SwZjIsVpbq4LxUW9IxAEwYzGcSgZ4n5Q8X8TndowsDUzoccPFGhdwIDAQAB;

DKIM-Result: pass

============================================================================
DMARC: pass
============================================================================

_dmarc.gmail.com: v=DMARC1; p=none; sp=quarantine; rua=mailto:mailauth-reports@google.com
Received-SPF: pass (appmaildev.com: domain of *****email address *******@gmail.com designates 209.85.215.196 as permitted sender) client-ip=209.85.215.196
Authentication-Results: appmaildev.com;
    dkim=pass header.d=gmail.com;
    spf=pass (appmaildev.com: domain of *****email address *******@gmail.com designates 209.85.215.196 as permitted sender) client-ip=209.85.215.196;
    dmarc=pass (adkim=r aspf=r p=none) header.from=gmail.com;

============================================================================
DomainKey: none
============================================================================

DomainKey-Result: none (no signature)
If DKIM result is passed, you can ignore DomainKey result: none
Notice: DomainKey is obsoleted standard, the new standard is DKIM.

============================================================================
PTR: ExistsRecord
============================================================================

Sender-IP: 209.85.215.196
Query 196.215.85.209.in-addr.arpa
Host: mail-pg1-f196.google.com

============================================================================
RBL: Listed
============================================================================

dnsbl.sorbs.net:LISTED - http://www.sorbs.net
spam.dnsbl.sorbs.net:LISTED - http://www.sorbs.net

bl.spamcop.net:Not Listed (OK) - http://bl.spamcop.net 
cbl.abuseat.org:Not Listed (OK) - http://cbl.abuseat.org 
b.barracudacentral.org:Not Listed (OK) - http://www.barracudacentral.org/rbl/removal-request 
http.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
dul.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
misc.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
smtp.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
socks.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
web.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
zombie.dnsbl.sorbs.net:Not Listed (OK) - http://www.sorbs.net 
pbl.spamhaus.org:Not Listed (OK) - http://www.spamhaus.org/pbl/ 
sbl.spamhaus.org:Not Listed (OK) - http://www.spamhaus.org/sbl/ 
xbl.spamhaus.org:Not Listed (OK) - http://www.spamhaus.org/xbl/ 
zen.spamhaus.org:Not Listed (OK) - http://www.spamhaus.org/zen/ 
ubl.unsubscore.com:Not Listed (OK) - http://www.lashback.com/blacklist/ 
rbl.spamlab.com:Not Listed (OK) - http://tools.appriver.com/index.aspx?tool=rbl 
dyna.spamrats.com:Not Listed (OK) - http://www.spamrats.com 
noptr.spamrats.com:Not Listed (OK) - http://www.spamrats.com 
spam.spamrats.com:Not Listed (OK) - http://www.spamrats.com 
cbl.anti-spam.org.cn:Not Listed (OK) - http://www.anti-spam.org.cn/?Locale=en_US 
cdl.anti-spam.org.cn:Not Listed (OK) - http://www.anti-spam.org.cn/?Locale=en_US 
dnsbl.inps.de:Not Listed (OK) - http://dnsbl.inps.de/index.cgi?lang=en 
drone.abuse.ch:Not Listed (OK) - http://dnsbl.abuse.ch 
httpbl.abuse.ch:Not Listed (OK) - http://dnsbl.abuse.ch 
korea.services.net:Not Listed (OK) - http://korea.services.net 
short.rbl.jp:Not Listed (OK) - http://www.rbl.jp 
virus.rbl.jp:Not Listed (OK) - http://www.rbl.jp 
spamrbl.imp.ch:Not Listed (OK) - http://antispam.imp.ch 
wormrbl.imp.ch:Not Listed (OK) - http://antispam.imp.ch 
virbl.bit.nl:Not Listed (OK) - http://virbl.bit.nl  
rbl.suresupport.com:Not Listed (OK) - http://suresupport.com/postmaster 
dsn.rfc-ignorant.org:Not Listed (OK) - http://www.rfc-ignorant.org/policy-dsn.php 
spamguard.leadmon.net:Not Listed (OK) - http://www.leadmon.net/SpamGuard/ 
dnsbl.tornevall.org:Not Listed (OK) - http://opm.tornevall.org 
netblock.pedantic.org:Not Listed (OK) - http://pedantic.org 
multi.surbl.org:Not Listed (OK) - http://www.surbl.org 
ix.dnsbl.manitu.net:Not Listed (OK) - http://www.dnsbl.manitu.net 
tor.dan.me.uk:Not Listed (OK) - http://www.dan.me.uk/dnsbl 
rbl.efnetrbl.org:Not Listed (OK) - http://rbl.efnetrbl.org 
dnsbl.dronebl.org:Not Listed (OK) - http://www.dronebl.org 
access.redhawk.org:Not Listed (OK) - http://www.redhawk.org/index.php?option=com_wrapper&Itemid=33 
db.wpbl.info:Not Listed (OK) - http://www.wpbl.info 
rbl.interserver.net:Not Listed (OK) - http://rbl.interserver.net 
query.senderbase.org:Not Listed (OK) - http://www.senderbase.org/about 
bogons.cymru.com:Not Listed (OK) - http://www.team-cymru.org/Services/Bogons/ 
csi.cloudmark.com:Not Listed (OK) - http://www.cloudmark.com/en/products/cloudmark-sender-intelligence/index 


============================================================================
Original message source
============================================================================
x-sender: *****email address *******@gmail.com
x-receiver: test-0b29286d@appmaildev.com
Received: from mail-pg1-f196.google.com ([209.85.215.196]) by appmaildev.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384);
	 Thu, 26 Mar 2020 02:54:10 +0000
Received: by mail-pg1-f196.google.com with SMTP id d17so2164300pgo.0
        for <test-0b29286d@appmaildev.com>; Wed, 25 Mar 2020 19:54:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:to:from:reply-to:subject:message-id:mime-version
         :content-transfer-encoding;
        bh=f4K97XNKsUiB26UotviTTVVweoWbCaqTM0QDTnyJQWU=;
        b=ZCIcF0FB6+mvmp9c3vhkWp2A4JGK2dvQje9zERX1DKhd1KimaGLgOO+lMkCdf0/Qgh
         Sjwfky334/VOZyUskyw+VYNpyRcMk0YsixduBCGBfePesptYuWt7HuleYvXHAiXdC734
         dS+STph/p812rBKd/x+ydkI1OP/qRiDHfMqABkgDrH871kVmaDt1vr7hz8Emvx0J8BGT
         su5j/Zo6Bo9tCXCvmrruPzPCM9EmRoB1qQUhmSwlI6qvBp+DJAn6d8GJk7FG6EyziXrZ
         jGXix8oJcdyrLrYS3gc1Oq5PxMm8bf+Zi+4zzzgaLa0Ws3e6oyQIxn/p9kXAwWsFtRLW
         HvAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:to:from:reply-to:subject:message-id
         :mime-version:content-transfer-encoding;
        bh=f4K97XNKsUiB26UotviTTVVweoWbCaqTM0QDTnyJQWU=;
        b=Iq3LvXZWDivohmxG/8l8wzNbXUqa4J3YbL0EX9I3ESxorvqRAdY2pFycg6vDP30xd1
         asvPO/XAsxhsXH+389j2mtTlktf3n8IGhuVt099ydNL19y4mnIlQidigjEljlmKHpq8q
         FVk6BY+aC6+qzENMR8DHD8Y+Yu2rpn0sZoNH8MDcIpOjRTs9SYdICyuNynePmFdK/6TF
         7IZ/pWvHlk7Qu4saNyvnU1RVJ0KBGKp06h4HpHXFPHAcztXGJcxefmEKt5PD0EFoioDG
         Fn9WAt52NOiLPzIh2u+YrJcB2ppg04vkLjkkH5k/LGl9ndFmJYyNfwiyfJ4XgA3y1+vB
         pcrA==
X-Gm-Message-State: ANhLgQ3W2RUN2B/DEqD75ljyFNWWM4tC6Fqt/oo9Mm0aO5/pFKZlAP+h
	4V2Uie704qvH7RQsymGWAEDfhE0y
X-Google-Smtp-Source: ADFU+vug+XoM44BS3nD1fFPhcwXUkhYDZTRCg+QnQ9dlwKZ6LccXJmW5RRrOSfwA2xOJpvzkRGF/oA==
X-Received: by 2002:a62:a116:: with SMTP id b22mr6945738pff.122.1585191248316;
        Wed, 25 Mar 2020 19:54:08 -0700 (PDT)
Return-Path: <*****email address *******@gmail.com>
Received: from testlab.frankystudio.cf (220-135-172-244.HINET-IP.hinet.net. [220.135.172.244])
        by smtp.gmail.com with ESMTPSA id 26sm428775pfp.130.2020.03.25.19.54.07
        for <test-0b29286d@appmaildev.com>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 25 Mar 2020 19:54:07 -0700 (PDT)
Date: Thu, 26 Mar 2020 02:54:06 +0000
To: test-0b29286d@appmaildev.com
From: =?utf-8?B?5Y+w54Gj6Z2S5bm06buR5a6i5p2+IEhhY2thdGhvbiBUYWl3YW4gSnIu?= <*****email address *******@gmail.com>
Reply-To: =?utf-8?B?5Y+w54Gj6Z2S5bm06buR5a6i5p2+IEhhY2thdGhvbiBUYWl3YW4gSnIu?= <*****email address *******@gmail.com>
Subject: =?utf-8?B?5a+G56K86YeN6Kit56K66KqN5L+hIC0g5Y+w54Gj6Z2S5bm06buR5a6i5p2+?=
Message-ID: <GaszbDyrFUDYUaIS4x1l0iMHUq2emazF882ycQeIwA@testlab.frankystudio.cf>
X-Mailer: PHPMailer 6.1.5 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-OriginalArrivalTime: 26 Mar 2020 02:54:10.0026 (UTC) FILETIME=[D2D52CA0:01D60319]

<h1>密碼重設確認信 - 活動名稱</h1>
					<p>使用者您好:<br><br>
						我們收到您重設密碼的申請<br><br>
						您的密碼重設連結如下:(有效時間為10分鐘)<br>
    					<a href='https://example.com/auth/reset_password/YfDiT2nHv0N56cZiDTsHj15JS'>
							https://example.com/auth/reset_password/YfDiT2nHv0N56cZiDTsHj15JS
    					</a><br>

============================================================================

黃彥儒 iT邦高手 1 級 ‧ 2020-03-26 11:03:18 檢舉

好吧,你大概撞到Gmail的AI了,只能多試試試看他表示方法
有可能加上:

  1. 退訂連結
    就可以過了,只能多多嘗試,沒有其他辦法
    抱歉幫不上忙
Franky Chen iT邦研究生 3 級 ‧ 2020-03-26 11:04:19 檢舉

好的 謝謝大大

Franky Chen iT邦研究生 3 級 ‧ 2020-03-26 11:16:30 檢舉

感謝大大回答

我剛剛用Gmail的撰寫工具寄出了一封email內有一個連結
發現他的連結html為

<div dir="ltr">
	<a href="www.google.com">		
        google
    </a>
</div>

這樣的格式

然後我剛剛把PHP改寫成

$mail->Body    = "<h1>密碼重設確認信</h1>
<p>使用者您好:<br><br>
我們收到您重設密碼的申請<br><br>
您的密碼重設連結如下:(有效時間為10分鐘)<br>
<div dir=\"ltr\">
    <a href='".base_url()."auth/reset_password/".$randomString."'>
       ".base_url()."auth/reset_password/".$randomString."
    </a>
</div>
<br>
<hr>
若您未申請密碼重設,請直接忽略此信 <br><br>
*此信為系統自動寄出,請勿直接回覆*
</p>";

就沒被擋信了......

我要發表回答

立即登入回答