Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Jimmy Hawkins   on Apr 18 In Java Category.

  
Question Answered By: Dirck Jansen   on Apr 18

U can use the steps as below:

- import classes from javax.mail and javax.mail.internet packages
- create a Properties object and put value of smtp host in its property
"mail.smtp.host". Please note that this host should be able to/configured to
send mails outside
- create a Session object with this property, like Session session =
Session.getDefaultInstance([prop obj],null)
- create a message object using session object, like Message msg = new
MimeMessage(session)
- set from, to, subject, text using appropriate set methods on msg object.
- Use the static send method of Transport class to send mail.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Help needed on Java Mail Or get search suggestion and latest updates.


Tagged: