dcsimg
How can I send a mail using SMTP?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jack_Zhuo
Posted On:   Thursday, December 12, 2002 10:15 PM

I test the javamail demo msgsend.java, but it display: javax.mail.SendFailedException: Sending failed; nested exception is: class javax.mail.SendFailedException: Invalid Addresses; nested exception is: class javax.mail.SendFailedException: 553 Relay restriction. at javax.mail.Transport.send0(Transport.java:218) at javax.mail.Transport.send(Transport.java:80) at msgsend. (msgsend.java:170) at msgsend.main(msgsend.java:60) How can i DO?    More>>

I test the javamail demo msgsend.java, but it display:


javax.mail.SendFailedException: Sending failed;

nested exception is:

class javax.mail.SendFailedException: Invalid Addresses;

nested exception is:

class javax.mail.SendFailedException: 553 Relay restriction.


at javax.mail.Transport.send0(Transport.java:218)

at javax.mail.Transport.send(Transport.java:80)

at msgsend. (msgsend.java:170)

at msgsend.main(msgsend.java:60)





How can i DO?

   <<Less

Re: How can I send a mail using SMTP?

Posted By:   Gautam_Marwaha  
Posted On:   Thursday, December 12, 2002 10:48 PM

You are probably doing one or more of the following:

1. setting email ids in the wrong format for the recipient

2. the SMTP server does not relay mails to any domain other than the ones configured on it. By default, most servers running SMTP service on your network will relay local mails which have the same domain name as the server. Try sending a mail to an address in the same domain - something like yourself@youdomain.com and if that works check the server configuration settings for relaying

3. you are probably trying to send email using an SMTP server on the internet which very rightly will not relay mails for you. Use your own SMTP server which is configured to relay mails and has acccess to DNS server(s)


To start with set session.setDebug(true) and try your program again - will show you more detailed info on what's going on

Also see http://www.jguru.com/faq/view.jsp?EID=352951

About | Sitemap | Contact