Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Aatif Imran

Greenhorn
+ Follow
since Aug 15, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aatif Imran

Obviously your best mate for sending email is java mail. Configure the helow properties and you'll be good.



//System properties
Properties props = new Properties();

// Setup your mail server
props.put("mail.smtp.host", SMTP_HOST);

props.put("mail.smtp.user",FROM_NAME);

props.put("mail.smtp.ssl.enable", "true");

props.put("mail.smtp.port", "25");

props.put("mail.debug", "true");

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

props.put("mail.smtp.starttls.enable","true");

props.put("mail.smtp.EnableSSL.enable","true");

props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");

props.setProperty("mail.smtp.socketFactory.fallback", "false");

props.setProperty("mail.smtp.port", "465");

props.setProperty("mail.smtp.socketFactory.port", "465");


Infact, I have a complete working example on my blog.See here
7 years ago