Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does props.put("mail.smtp.host", host) in JavaMail do?

Can anybody explain me what this line means in JavaMail API?

props.put("mail.smtp.host", host);

It is used to setup a mail server, but I don't understand it.

like image 704
simplyblue Avatar asked Jun 02 '10 12:06

simplyblue


1 Answers

The String variable host contains the DNS name of a server that accepts connections on port 25 for SMTP. Adding this property to the props collection, which is in turn passed into Javamail, tells Javamail what host to send the mail to, initially.

You might also see something that helps in this answer.

like image 194
bmargulies Avatar answered Sep 27 '22 18:09

bmargulies