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

Mayank Jain
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("", _host);//
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, I am passing xyz.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic