palavi 0 Junior Poster in Training

Hi,

can anybody tell me how to send mail from smtp to different email-id s like gmail,yahoo rediff from my java application.

I am able to send mail from my machine within the company email-ids but not on other , if i put gmail or yahoo address im getting this exception.. can anybody know how to achieve this... i m getting below exception on ginvg other email.

Exception in thread "main" javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
	com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
;
  nested exception is:
	com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
;
  nested exception is:
	com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay

	at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
	at javax.mail.Transport.send0(Transport.java:169)
	at javax.mail.Transport.send(Transport.java:98)
	at SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:99)
	at SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:62)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
;
  nested exception is:
	com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay

	at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
	... 5 more
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay

	... 6 more