一.簡介 smtp
smtp(Simple Mail Transfer Protocal) 簡單郵件傳輸協定, 是RR協定(Request / Response),指令和相應 都基于ascll碼,以CR(carrage 回車) LF(line feed換行)為結束符, Smtp 在tcp協定的25端口偵聽連接配接。
ESMTP(Extension Simple Mail Transfer Protocal)SMTP的擴充。 與smtp唯一的差別是登入的時候需要認證(authentication)
二. 過程
cmd-> telnet smtp.qq.com 25
helo hostname // 向伺服器介紹自己
auth login // authentication 發送認證 指令行,随後發送User name and Password
MTA2MjEzMzEwNEBxcS5jb20= // [email protected] 的base64編碼
******* // 密碼的base64編碼
mail from: [email protected]<[email protected]> // 發送人位址 ,必須要 是郵箱的認證名,否則會有501錯誤
rcpt to: [email protected]<[email protected]> // 接受人位址,此處可有多個 rcpt to
data // 郵件開始, 以CRLF.CRLF 結束(即回車換行 . 回車換行)
From: [email protected] // 出現在發件人欄中的内容
to: [email protected] //出現在收件人欄中的内容
Subject: Test // 郵件的主題
(輸入空行)
Hello smtp! // 空行後輸入 發送的正文内容。
. // 結束符
quit // 結束session會話。