• Post Reply Bookmark Topic Watch Topic
  • New Topic

sending email to yahoo via javamail ?  RSS feed

 
jhun kam
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i got a 'slight' problem in sending email to my own account at yahoo.com. here's the 'error' messages:
javax.mail.SendFailedException: Sending failed; nested exception is:
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
javax.mail.SendFailedException: 550 5.7.1 Unable to relay for jhun_kam@y
ahoo.com
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at SendEmail.main(SendEmail.java:47)
can anybody tell me the reason of this ? i'm sending my email through my own SMTP server at localhost.
Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that "unable to relay" means that your local server does not recognize you as having an email account there. It thinks you are trying to send mail illegally. Try it with a from address that the local server knows.
Bill
 
jhun kam
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhh, thank you very much, i got my problem solved now. The problem was that i didnt activate relaying ability from my SMTP server.
Now a new problem arise, it's quit amusing. I was able to deliver emails to my account at elus1v3@hotmail.com, but unable to deliver emails to my jhun_kam@yahoo.com. The code is the same. I only make a change in the recipient name(elus1v3@hotmail.com into jhun_kam@yahoo.com). The program exits gracefully, no error nor warnings, but none of the messages arrived at my yahoo account. Any ideas, please ?
 
Les Dsouza
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
1. From account should be a valid account on the yahoo server.
2. Yahoo mail server requires authentication, so set the property "mail.smtp.auth" to true.
3. To get debugging info call setDebug(true) on session object.
Hope this helps.
 
Jhun Hoon
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again, thanks for the help. I think i've found the culprit of my problem. It seems that if i want to send to yahoo mail, i must have a valid/registered domain in the internet. Setting the 'From' field to a hostname that is not registered in the internet will not be accepted by yahoo mail. (Strangely, hotmail will accept without further checking
Thanks for the help, ranchers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!