我正在尝试发送邮件。我在下面得到例外 [英] i am try send mail .i get exception below
本文介绍了我正在尝试发送邮件。我在下面得到例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
rg.springframework.mail.MailSendException;嵌套异常详细信息(1)是:
失败消息1:
rg.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
javax.mail.MessagingException: can't determine local email address
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1001)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:634)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:402)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:341)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:337)
at utility.SendMail.sendMail(SendMail.java:66)
at webService.DeviceInfoMailSenderThread.sendMail(DeviceInfoMailSenderThread.java:395)
推荐答案
有很多信息这里 [ ^ ]。没有看到你的代码,我无法进一步帮助,但是我会检查你是否在消息上设置了FROM地址;这是本地电子邮件地址。
There is a lot of information here[^]. without seeing your code, I can''t help further, however I would check you have set the FROM address on the message; that''s the local e-mail address.
您的电子邮件设置为false,来自地址不对。因此无法发送消息。必须有一些地址 - 不是有效的地址,但必须有一些。
请参考这些文件:
JavaMail API基础知识 [< a href =https://www6.software.ibm.com/developerworks/education/j-javamail/j-javamail-a4.pdftarget =_ blanktitle =New Window> ^ ] (PDF)
通过Java发送电子邮件 [< a href =http://www.vipan.com/htdocs/javamail.htmltarget =_ blanktitle =新窗口> ^ ](网站)
所有关于JavaMail [ ^ ](Scribd.com)
所有3个人都有关于如何创建有效电子邮件的良好教程风格说明。
请同时请勿使用网络电子邮件帐户进行测试。这些将在几次尝试后阻止/禁止你。
在开发系统上使用本地电子邮件服务器要好得多。请参阅免费的 HMailServer [ ^ ],操作简单,非常适合开发消息处理系统。请注意,这个也有自动禁止选项 - 您可以在首选项中将其关闭。
Your email is set up false, the from address is not right. Therefore the message cannot be send. there must be some address - not a valid one, but there must be some.
Please refer to these documentations:
Fundamentals on the JavaMail API[^] (PDF)
Email through Java[^] (website)
All about JavaMail[^] (Scribd.com)
All 3 of them have good tutorial style explanation on how to create a valid email.
Please also do NOT use a web email account for testing. Those will block/ban you after a few attempts.
It''s much better o use a local email server on your development system. Please refer to the free HMailServer[^], which is simple to operate and great for developing message handling systems. be aware that also this one has a auto-ban option - you can switch it off in the preferences.
这篇关于我正在尝试发送邮件。我在下面得到例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文