debbicty
2009-02-09 13:16关于javamail发送到本机的问题
是我的本机地址错误吗?
public String send1() throws Exception
{
//确定要发送的邮件服务器地址
String mailserver = "liweiqiang";
try
{
//设置邮件的传输协议
Properties prop = System.getProperties();
prop.put("mail.smtp.host", mailserver);
prop.put("mail.smtp.auth","false");
//建立邮件发送的连接
Session s = Session.getDefaultInstance(prop, null);
//创建发送信息的载体
Message message = new MimeMessage(s);
//设置相关的邮件属性
message.setFrom(new InternetAddress(email.getForm()));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(email.getTo()));
message.setSubject(email.getTitle());
message.setText(email.getContext());
//发送
Transport.send(message);
System.out.println("-------send ok----------------");
}
catch(Exception e)
{
e.printStackTrace();
throw new Exception("邮件发送失败..");
}
return SUCCESS;
}
是我的本机地址错误吗?
com.sun.mail.smtp.SMTPSendFailedException: 550 admin@zhaohaitao.com esmtp authen
tication failed and this mail server requires smtp authentication.
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- JavaMail如何获取邮件发送者的IP?
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 关于javamail的问题?
- 企业应用
- 0个回答
- 使用javamail发送邮件,sina的邮箱作为发信人不行
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 关于javamail发送到本机的问题
- 企业应用
- 0个回答
- javamail发送邮件问题
- tomcat
- 0个回答
换一换