• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

sending email to yahoo via javamail ?

 
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.
 
Author and all-around good cowpoke
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 ?
 
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.
 
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.
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic