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

后端 未结 2 1872
梦如初夏
梦如初夏 2021-02-14 01:43

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\

相关标签:
2条回答
  • 2021-02-14 02:23

    This value helps Javamail to understand to which server it has to hit for DNS name. Its ususally through a port opened( default 25).

    0 讨论(0)
  • 2021-02-14 02:36

    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.

    0 讨论(0)
提交回复
热议问题