使用telnet测试发送邮件

Telnet发送邮件

准备环境

测试邮件用户名和密码:

139邮箱:415558259@139.com 密码:415558259

Linux操作系统:

cat /etc/redhat-release
CentOS release 6.5 (Final)

获取邮箱和密码的Base64的值
415558259@139.com的base64值是:NDE1NTU4MjU5QDEzOS5jb20=
415558259的base64值是:NDE1NTU4MjU5
可以使用下面代码获取base64值
package com.hh.socket;
 
import java.io.IOException;
import sun.misc.BASE64Encoder;
 
public class Test {
 
    public static void main(String[] args) throws IOException {
    String str=new BASE64Encoder().encode("415558259@139.com".getBytes()); 
    System.out.println(str);
    str=new BASE64Encoder().encode("415558259".getBytes()); 
    System.out.println(str);
    }
 
}

测试过程

    [tony@localhost Desktop]$  telnet smtp.139.com 25
    Trying 221.176.9.170...
    Connected to smtp.139.com.
    Escape character is '^]'.
    220 localhost richmail system v10(2ef658d3a57dec2-ce252)
    quit
    221 localhost richmail system closing transmission channel
    Connection closed by foreign host.
    [tony@localhost Desktop]$ telnet smtp.139.com 25
    Trying 221.176.9.170...
    Connected to smtp.139.com.
    Escape character is '^]'.
    220 localhost richmail system v10(2f0158d3a5c7747-52df5)
    EHLO localhost
    250-mail
    250-STARTTLS
    250-PIPELINING
    250-AUTH LOGIN PLAIN
    250-AUTH=LOGIN PLAIN
    250 8BITMIME
    AUTH LOGIN
    334 dXNlcm5hbWU6
    aGVuZ2h1aXhpbmRhQDEzOS5jb20=
    334 UGFzc3dvcmQ6
    aGVuZ2h1aXhpbmRh
    235 Authentication successful
    MAIL FROM:<415558259@139.com>
    250 ok
    RCPT TO:<15367811408@139.com>
    250 ok
    DATA
    354 end with .
    From: "Bob Example" <415558259@139.com>
    To: "Alice Example" <15367811408@139.com>
    Subject: Test message
    Hello Alice.
    This is a test message with 5 header fields and 4 lines in the message body.
    Your friend,
    Bob
    .
    250 ok
    QUIT
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值