SMTP host/port values for Microsoft Exchange using JavaMail API in Android

581 views Asked by At

What are the smtp host, smtp port, smtp socketfactory port for sending emails using a Microsoft Exchange mail account?

I have referred to this amazing tutorial right here but it is only applicable for sending emails using google accounts. So the snippet of code below shows the configuration properties for gmail.

props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.".smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");

So what are the values that I should write instead if I want to send emails using my MS Exchange account?

1

There are 1 answers

0
biancii On BEST ANSWER

JavaMail does not provide a mail server for you to use. You must use your own mail server, or one provided by your Internet Service Provider or the company you work for. Your network administrator can give you the information necessary to configure JavaMail to work with your mail server.

Reference: http://www.oracle.com/technetwork/java/javamail/faq/index.html#whichserver

Thanks for this, Bill Shannon