开发者

error handling on SMTP sending using javax.mail

开发者 https://www.devze.com 2023-03-25 11:51 出处:网络
I writing a mail client for sending of email notification using Javax.mail SMTP. I need to validate the mail delivery开发者_JAVA百科. my first step ofcourse was to catch built in exception.

I writing a mail client for sending of email notification using Javax.mail SMTP. I need to validate the mail delivery开发者_JAVA百科. my first step ofcourse was to catch built in exception.

My question does those exceptioon cover delivery errors (i.e. failed delivery becouse of wrong adrress, target server not found etc) or do I need to do extra work to cover that.

Thanks,

Alex


Once the email is successfully delivered to the destination server, it's gone. If that server is a relay (as you would typically find in a corporate environment) the message could bounce later when the relay tries to send it to the real destination.

At that poing, a bounce message would be returned to the sending address. If you need to handle those, you need to ensure that the sending address is deliverable to a mailbox to which you have access. Then you need to somehow (i.e. procmail) get the incoming bounces to another program you write which handles them.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号