发邮件的问题 catch(Exception e){ System.out.println(e); //一般mail服务器需要验证的; 看看错误原因} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 smtp.citiz.net 的确是需要验证的(实际上现在几乎没有不需要验证的,呵呵).以下测试可以证明:c:>telnet smtp.citiz.net 25220 Welcome, Netdao MailPro Engin ESMTP250-Welcome, Netdao MailPro Engin250-AUTH=LOGIN250-PIPELINING250 8BITMIME334 VXNlcm5hbWU6.........需要验证的,你可以这样发送命令:1.client:[root@localhost root]# telnet smtp.server.com 25Trying smtp.server.com...Connected to smtp.server.com.Escape character is '^]'.client尝试连接smtp server的25端口2.server:220 .localdomain ESMTP Sendmail 8.12.9/8.12.9; Sat, 16 Oct 2004 09:10:36 +0800连接成功,server返回220 3.client:ehlo smtp.server.comclient 发送"ehlo server-name"4.server:250 smtp.server.com Hello smtp.server.com , pleased to meet youserver 响应2505.client:AUTH LOGIN client 发送"auth login",请求验证6.server:334 dXNlcm5hbWU6 server 返回334,并返回base64码的"username:",要求用户输入用户名7.client:dXNlcm5hbWU6 client发送经过base64编码的用户名8.server:334 cGFzc3dvcmQ6 server 返回334,并返回base64码的"password:",要求用户输入密码9.client:cGFzc3dvcmQ6 client发送自己的密码(base64编码过的密码)10.server:235 Authentication successful.验证成功的话,server返回235 (此后的过程就和无须验证发email的方式一样了)11.client:mail from:[email protected]client 发送"mail from:",即:发件人 12.server:250 2.1.0 [email protected]... Sender okserver返回250,表示操作成功13.client:rcpt to:[email protected]client发送"rcpt to:",即:收件人14.server:250 2.1.5 [email protected]... Recipient okserver返回250,表示操作成功15.client:dataclient发送"data",表示开始写邮件内容16.server:354 Enter mail, end with "." on a line by itselfserver返回354,表示client可以开始输入内容17.client:hi.client要发送的内容,以点"."结束18.server:250 2.0.0 i9G1Aa78019430 Message accepted for deliveryserver返回250,表示操作成功19.client:quitclient发送"quit",结束会话注意里面的验证部分都是要求base64编码的,根据这个修改你的程序就行了 泛型数据丢失问题,哪位大侠赐教下~ Thank you~ 猜数字游戏的问题 JAVA能修改IP数据包的内容么? 关于servlet的一个文件有所不懂 求助!如何实现用java对swf格式进行缩放 十进制的数转成二进制怎么转? 如何绘制特定的按纽图案 高中生Java程序员,找工作难不难? 这个问题竟然没人能解决????? JS如何从数据库中请求数据? Java Mail中设置发件人姓名的问题!急 请问一下大连东软的商用事业部和社报事业部都怎么样
c:>telnet smtp.citiz.net 25
220 Welcome, Netdao MailPro Engin ESMTP
250-Welcome, Netdao MailPro Engin
250-AUTH=LOGIN
250-PIPELINING
250 8BITMIME
334 VXNlcm5hbWU6
.........
需要验证的,你可以这样发送命令:
1.client:[root@localhost root]# telnet smtp.server.com 25
Trying smtp.server.com...
Connected to smtp.server.com.
Escape character is '^]'.
client尝试连接smtp server的25端口
2.server:220 .localdomain ESMTP Sendmail 8.12.9/8.12.9; Sat, 16 Oct 2004 09:10:36 +0800
连接成功,server返回220
3.client:ehlo smtp.server.com
client 发送"ehlo server-name"
4.server:250 smtp.server.com Hello smtp.server.com , pleased to meet you
server 响应250
5.client:AUTH LOGIN
client 发送"auth login",请求验证
6.server:334 dXNlcm5hbWU6
server 返回334,并返回base64码的"username:",要求用户输入用户名
7.client:dXNlcm5hbWU6
client发送经过base64编码的用户名
8.server:334 cGFzc3dvcmQ6
server 返回334,并返回base64码的"password:",要求用户输入密码
9.client:cGFzc3dvcmQ6
client发送自己的密码(base64编码过的密码)
10.server:235 Authentication successful.
验证成功的话,server返回235 (此后的过程就和无须验证发email的方式一样了)
11.client:mail from:[email protected]
client 发送"mail from:",即:发件人
12.server:250 2.1.0 [email protected]... Sender ok
server返回250,表示操作成功
13.client:rcpt to:[email protected]
client发送"rcpt to:",即:收件人
14.server:250 2.1.5 [email protected]... Recipient ok
server返回250,表示操作成功
15.client:data
client发送"data",表示开始写邮件内容
16.server:354 Enter mail, end with "." on a line by itself
server返回354,表示client可以开始输入内容
17.client:hi
.
client要发送的内容,以点"."结束
18.server:250 2.0.0 i9G1Aa78019430 Message accepted for delivery
server返回250,表示操作成功
19.client:quit
client发送"quit",结束会话注意里面的验证部分都是要求base64编码的,根据这个修改你的程序就行了