Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending Mail using smtp.mai.yahoo.com

 
Mayank Jain
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to send mail to some correct & existing E-Mail IDs, from a stand-alone java application using Java Mail API.
No exception is thrown while sending the mail, but the mail is not reaching to the target mail-nox.
Code :
props.put("mail.smtp.host", _host);//smtp.mail.yahoo.com
props.put("mail.smtp.user", _user); //xyz .

props.put("mail.smtp.auth", "true");

_session = Session.getInstance(props, null);

_transport = _session.getTransport("smtp");
_transport.connect(_host, _user, _pwd);
_transport.sendMessage(mimeMsg, mimeMsg.getAllRecipients());

Please note that in the mimeMsg.setFrom(); I am passing a user name, its not a complete E-Mail address. that is for a e-mail address xyz@yahoo.com, I am passing xyz.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic