//身份验证
out.println(" AUTH LOGIN ");
out.flush();
response = in.readLine();
ok = response.startsWith("334");
if (!ok)
throw new IOException(response);
//输入用户名和密码
out.println( get64Code(user) ); //输入用户名
out.flush();
response = in.readLine();
ok = response.startsWith("334");
if (!ok)
throw new IOException(response);
out.println( get64Code(password) ); //输入密码
out.flush();
以上即为发送邮件时输入用户名和密码验证代码。
如果用jmail则更简单
out.println(" AUTH LOGIN ");
out.flush();
response = in.readLine();
ok = response.startsWith("334");
if (!ok)
throw new IOException(response);
//输入用户名和密码
out.println( get64Code(user) ); //输入用户名
out.flush();
response = in.readLine();
ok = response.startsWith("334");
if (!ok)
throw new IOException(response);
out.println( get64Code(password) ); //输入密码
out.flush();
以上即为发送邮件时输入用户名和密码验证代码。
如果用jmail则更简单
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货