views:

55

answers:

1

Hi,

I am working on to send email from my various accounts using java. And I sent mail from my gmail account successfully. Now I tried to send email from my yahoomail by changing the smtp host as "smtp.mail.yahoo.com" and port value as 25. But I am getting "SMTPSendFailedException". Can I know what changes I need to do to make it working ?

These are all the values I have set as properties in my code for yahoomail.

props.put("mail.smtp.starttls.enable", "true"); props.setProperty("mail.transport.protocol", "smtp"); props.put("mail.smtp.auth", "true"); props.setProperty("mail.smtp.host", "smtp.mail.yahoo.com"); props.put("mail.smtp.port", "25"); props.setProperty("mail.user", "username"); props.setProperty("mail.password", "password");

thanks,

Senthil.M

A: 

I believe Yahoo! Mail uses SMTPS:

props.setProperty("mail.transport.protocol", "smtps");
props.put("mail.smtps.auth", "true");
props.setProperty("mail.smtps.host", "smtp.mail.yahoo.com");
props.put("mail.smtps.port", "465");
props.setProperty("mail.user", "username");
props.setProperty("mail.password", "password");
schot