1. 程式人生 > 其它 >Telnet郵件伺服器傳送郵件

Telnet郵件伺服器傳送郵件

下面的例子是用139的smtp伺服器

telnet smtp.139.com 25     //telnet到smtp埠
Trying 120.232.169.42...
Connected to smtp.139.com.
Escape character is '^]'.
220 localhost richmail system v10(2f176279184726f-809c0) //伺服器返回220
helo mytest     //跟伺服器打招呼
250 localhost richmail system v10(2f176279184726f-809c0)  //伺服器返回250
auth login    //登入
334 dXNlcm5hbWU6 //伺服器返回334 *** //*此處輸入base64編碼後的qq郵箱名*/ 334 UGFzc3dvcmQ6 //伺服器返回334 *** //*此處輸入base64編碼後的授權碼*/ 235 Authentication successful //登入成功 mail from: <kfwtry@139.com> //發件郵箱 250 ok rcpt to: <[email protected]> //收件郵箱 250 ok data //開始寫信 354 end with . to:hello //郵件收件人的名稱 from:mytest //郵件來源名稱 subject: this
is a test telnet smtp mail //郵件標題 hello,my friend //訊息內容 This is a test mail form 139.com //訊息內容 . //英文的點,郵件結束標誌。即刻傳送

 Base64線上編碼/解碼  https://base64.us/