摘要:初探協(xié)議百度百科即簡單郵件傳輸協(xié)議它是一組用于由源地址到目的地址傳送郵件的規(guī)則,由它來控制信件的中轉(zhuǎn)方式。協(xié)議屬于協(xié)議簇,它幫助每臺計算機在發(fā)送或中轉(zhuǎn)信件時找到下一個目的地。服務(wù)器則是遵循協(xié)議的發(fā)送郵件服務(wù)器,用來發(fā)送或中轉(zhuǎn)發(fā)出的電子郵件。
初探smtp協(xié)議 百度百科
SMTP(Simple Mail Transfer Protocol)即簡單郵件傳輸協(xié)議,它是一組用于由源地址到目的地址傳送郵件的規(guī)則,由它來控制信件的中轉(zhuǎn)方式。SMTP協(xié)議屬于TCP/IP協(xié)議簇,它幫助每臺計算機在發(fā)送或中轉(zhuǎn)信件時找到下一個目的地。通過SMTP協(xié)議所指定的服務(wù)器,就可以把E-mail寄到收信人的服務(wù)器上了,整個過程只要幾分鐘。SMTP服務(wù)器則是遵循SMTP協(xié)議的發(fā)送郵件服務(wù)器,用來發(fā)送或中轉(zhuǎn)發(fā)出的電子郵件。
(傳送門)
連接和發(fā)送郵件步驟如下:
?。?)建立TCP連接;
(2)客戶端發(fā)送HELO命令以標(biāo)識發(fā)件人的身份,服務(wù)器以O(shè)K作為響應(yīng),表明準(zhǔn)備接收;
(3)使用AUTH命令登錄SMTP服務(wù)器,輸入用戶名和密碼(用戶名和密碼要用base64進行加密);
(4)客戶端發(fā)送MAIL命令輸入發(fā)件人郵箱地址,服務(wù)器以O(shè)K作為響應(yīng);
?。?)客戶端發(fā)送RCPT命令,標(biāo)識該電子郵件的計劃接收人,服務(wù)器以O(shè)K作為響應(yīng);
?。?)協(xié)商結(jié)束后,使用DATA命令發(fā)送;
?。?)以"."號表示結(jié)束,輸入內(nèi)容一起發(fā)送出去,
(8)結(jié)束此次發(fā)送,用QUIT命令退出。
PHPmailer發(fā)送示例2017-06-16 14:29:13 SERVER -> CLIENT: 220 hello 2017-06-16 14:29:13 CLIENT -> SERVER: EHLO heqian-pc 2017-06-16 14:29:13 SERVER -> CLIENT: 250-localhost Hello EHLO heqian-pc 250-SIZE 131072 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP 2017-06-16 14:29:13 CLIENT -> SERVER: AUTH LOGIN 2017-06-16 14:29:13 SERVER -> CLIENT: 334 VXNlcm5hbWU= 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 SERVER -> CLIENT: 334 UGFzc3dvcmQ= 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 SERVER -> CLIENT: 235 Authentication successful 2017-06-16 14:29:13 CLIENT -> SERVER: MAIL FROM:跨郵件服務(wù)器之間的通信2017-06-16 14:29:13 SERVER -> CLIENT: 250 Ok 2017-06-16 14:29:13 CLIENT -> SERVER: RCPT TO: 2017-06-16 14:29:13 SERVER -> CLIENT: 250 Ok 2017-06-16 14:29:13 CLIENT -> SERVER: DATA 2017-06-16 14:29:13 SERVER -> CLIENT: 354 End data with . 2017-06-16 14:29:13 CLIENT -> SERVER: Date: Fri, 16 Jun 2017 14:29:13 +0000 2017-06-16 14:29:13 CLIENT -> SERVER: To: fage1151@qq.com 2017-06-16 14:29:13 CLIENT -> SERVER: From: =?utf-8?B?5piT6IGU5LqR?= 2017-06-16 14:29:13 CLIENT -> SERVER: Reply-To: =?utf-8?B?5piT6IGU5LqR?= <1151878751@qq.com> 2017-06-16 14:29:13 CLIENT -> SERVER: Subject: =?utf-8?B?5piT6IGU5LqR6aqM6K+B56CB?= 2017-06-16 14:29:13 CLIENT -> SERVER: Message-ID: 2017-06-16 14:29:13 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.23 (https://github.com/PHPMailer/PHPMailer) 2017-06-16 14:29:13 CLIENT -> SERVER: MIME-Version: 1.0 2017-06-16 14:29:13 CLIENT -> SERVER: Content-Type: multipart/alternative; 2017-06-16 14:29:13 CLIENT -> SERVER: boundary="b1_a2430819ef128b7b55181b6ebd2e021e" 2017-06-16 14:29:13 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: This is a multi-part message in MIME format. 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: --b1_a2430819ef128b7b55181b6ebd2e021e 2017-06-16 14:29:13 CLIENT -> SERVER: Content-Type: text/plain; charset=utf-8 2017-06-16 14:29:13 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: 你好 smtp 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: --b1_a2430819ef128b7b55181b6ebd2e021e 2017-06-16 14:29:13 CLIENT -> SERVER: Content-Type: text/html; charset=utf-8 2017-06-16 14:29:13 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: 你好 smtp
2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: --b1_a2430819ef128b7b55181b6ebd2e021e-- 2017-06-16 14:29:13 CLIENT -> SERVER: 2017-06-16 14:29:13 CLIENT -> SERVER: . 2017-06-16 14:29:13 SERVER -> CLIENT: 250 ok:queued as 2017-06-16 14:29:13 CLIENT -> SERVER: QUIT 2017-06-16 14:29:13 SERVER -> CLIENT: 221 Bye
連接和投遞步驟如下:
?。?)建立TCP連接;
(2)服務(wù)器發(fā)送HELO命令以標(biāo)識發(fā)件人的身份,目標(biāo)服務(wù)器以O(shè)K作為響應(yīng),表明準(zhǔn)備接收;
?。?)服務(wù)器發(fā)送MAIL 命令輸入發(fā)件人郵箱地址,目標(biāo)服務(wù)器以O(shè)K作為響應(yīng);
(4)服務(wù)器發(fā)送RCPT命令,標(biāo)識該電子郵件的計劃接收人,目標(biāo)服務(wù)器以O(shè)K作為響應(yīng);
(5)協(xié)商結(jié)束后,使用DATA命令發(fā)送;
(6)以"."號表示結(jié)束,輸入內(nèi)容一起發(fā)送出去,
?。?)結(jié)束此次發(fā)送,用QUIT命令退出。
PHPmailer發(fā)送示例2017-06-16 14:24:41 SERVER -> CLIENT: 220 hello 2017-06-16 14:24:41 CLIENT -> SERVER: EHLO heqian-pc 2017-06-16 14:24:41 SERVER -> CLIENT: 250-localhost Hello EHLO heqian-pc 250-SIZE 131072 250-PIPELINING 250 HELP 2017-06-16 14:24:41 CLIENT -> SERVER: MAIL FROM:怎么查看從郵件服務(wù)器到網(wǎng)易MX服務(wù)器的SMTP記錄?2017-06-16 14:24:41 SERVER -> CLIENT: 250 Ok 2017-06-16 14:24:41 CLIENT -> SERVER: RCPT TO: 2017-06-16 14:24:41 SERVER -> CLIENT: 250 Ok 2017-06-16 14:24:41 CLIENT -> SERVER: DATA 2017-06-16 14:24:41 SERVER -> CLIENT: 354 End data with . 2017-06-16 14:24:41 CLIENT -> SERVER: Date: Fri, 16 Jun 2017 14:24:41 +0000 2017-06-16 14:24:41 CLIENT -> SERVER: To: fage1151@qq.com 2017-06-16 14:24:41 CLIENT -> SERVER: From: =?utf-8?B?5piT6IGU5LqR?= 2017-06-16 14:24:41 CLIENT -> SERVER: Reply-To: =?utf-8?B?5piT6IGU5LqR?= <1151878751@qq.com> 2017-06-16 14:24:41 CLIENT -> SERVER: Subject: =?utf-8?B?5piT6IGU5LqR6aqM6K+B56CB?= 2017-06-16 14:24:41 CLIENT -> SERVER: Message-ID: <6fc893187701010670b0d152b2d954f6@heqian-pc> 2017-06-16 14:24:41 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.23 (https://github.com/PHPMailer/PHPMailer) 2017-06-16 14:24:41 CLIENT -> SERVER: MIME-Version: 1.0 2017-06-16 14:24:41 CLIENT -> SERVER: Content-Type: multipart/alternative; 2017-06-16 14:24:41 CLIENT -> SERVER: boundary="b1_6fc893187701010670b0d152b2d954f6" 2017-06-16 14:24:41 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: This is a multi-part message in MIME format. 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: --b1_6fc893187701010670b0d152b2d954f6 2017-06-16 14:24:41 CLIENT -> SERVER: Content-Type: text/plain; charset=utf-8 2017-06-16 14:24:41 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: 你好 smtp 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: --b1_6fc893187701010670b0d152b2d954f6 2017-06-16 14:24:41 CLIENT -> SERVER: Content-Type: text/html; charset=utf-8 2017-06-16 14:24:41 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: 你好 smtp
2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: --b1_6fc893187701010670b0d152b2d954f6-- 2017-06-16 14:24:41 CLIENT -> SERVER: 2017-06-16 14:24:41 CLIENT -> SERVER: . 2017-06-16 14:24:41 SERVER -> CLIENT: 250 ok:queued as 2017-06-16 14:24:41 CLIENT -> SERVER: QUIT 2017-06-16 14:24:41 SERVER -> CLIENT: 221 Bye
是不是發(fā)現(xiàn)郵件服務(wù)器之間和客戶端與郵件服務(wù)器之間的協(xié)議是如此的相似呢。
他們有什么區(qū)別呢。
一般情況下,客戶端與服務(wù)器交互是通過一個域名實現(xiàn)的,例如:smtp.qq.com,smtp.163.com,smtp.sina.cn
而郵箱服務(wù)器之間一般是通過郵箱后綴的mx郵件交換記錄來完成的。如何查看郵件服務(wù)器的mx記錄
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://specialneedsforspecialkids.com/yun/23095.html
摘要:協(xié)議接收郵件服務(wù)器,使用,端口號。發(fā)送郵件服務(wù)器,使用,端口號蘋果郵箱收件服務(wù)器主機名填什么您好,如果是給手機設(shè)置郵箱。郵箱的服務(wù)器端口號為,收件服務(wù)器端口號是,發(fā)件服務(wù)器端口號是最后點擊完成。郵件主機名該如何填寫?以qq為例,收件服務(wù)器為imap.qq.com,發(fā)件服務(wù)器為smtp.qq.com,具體如下:1.在郵箱中啟用IMAP服務(wù)。 在Mail中創(chuàng)建一個新的QQ郵箱賬戶,單擊手動設(shè)置進...
摘要:也就是說用戶先將郵件投遞到騰訊的服務(wù)器這個過程就使用了協(xié)議,然后騰訊的服務(wù)器將郵件投遞到網(wǎng)易的服務(wù)器這個過程也依然使用了協(xié)議,服務(wù)器就是用來收郵件。 郵件發(fā)送其實是一個非常常見的需求,用戶注冊,找回密碼等地方,都會用到,使用 JavaSE 代碼發(fā)送郵件,步驟還是挺繁瑣的,Spring Boot 中對于郵件發(fā)送,提供了相關(guān)的自動化配置類,使得郵件發(fā)送變得非常容易,本文我們就來一探究竟!看...
摘要:網(wǎng)上也有不少人反饋用手機客戶端無法使用新浪郵箱發(fā)送郵件,隨后我嘗試用登錄新浪郵箱,也出現(xiàn)只能接收郵件而不能發(fā)送郵件的情況。三附錄錯誤碼及建議解決方法發(fā)送郵件成功卻收不到郵件或收到郵件無主題無收件人亂碼新浪郵箱誠信平臺 前言 ??JavaMail的使用本身并不難,網(wǎng)上有不少案例,簡單易懂,而且有詳細的中文注解。但是由于JavaMail的機制設(shè)置不夠完善,特別是異常出錯時的參考信息太少,給...
摘要:是發(fā)送郵件的協(xié)議,內(nèi)置對的支持模塊和模塊可以發(fā)送純文本郵件郵件以及帶附件的郵件簡單郵件傳輸協(xié)議,是從源地址到目的地址傳送郵件的規(guī)則,由該協(xié)議控制信件的中轉(zhuǎn)方式的提供了一種很方便的途徑傳遞電子郵件,對進行了簡單的封裝發(fā)送純文本郵件導(dǎo)入模塊 SMTP是發(fā)送郵件的協(xié)議,Python內(nèi)置對SMTP的支持(smtplib模塊和email模塊),可以發(fā)送純文本郵件、HTML郵件以及帶附件的郵件 S...
閱讀 3702·2021-11-11 11:00
閱讀 2180·2021-10-08 10:05
閱讀 2671·2021-10-08 10:04
閱讀 3204·2021-09-30 09:48
閱讀 3763·2021-09-27 14:10
閱讀 1704·2021-09-09 09:33
閱讀 2100·2019-08-30 15:55
閱讀 1602·2019-08-30 13:53