JavaMail中的props.put(" mail.smtp.host",host)有什么作用? [英] What does props.put("mail.smtp.host", host) in JavaMail do?

查看:190
本文介绍了JavaMail中的props.put(" mail.smtp.host",host)有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能解释一下这条线在JavaMail API中的含义吗?

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.

推荐答案

字符串变量 host 包含接受端口连接的服务器的DNS名称25为SMTP。将此属性添加到props集合中,然后将其传递到Javamail,最初告诉Javamail将邮件发送到哪个主机。

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.

这篇关于JavaMail中的props.put(" mail.smtp.host",host)有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆