我试图在我的应用程序 java 中创建一个 EmailSender
我为电子邮件制作了我的框架,我用谷歌搜索了一些可以帮助我的例子,
所以我发现这个教程非常有用 http://www.javapractices.com/topic/TopicAction.do?Id=144
但我不明白这个配置是什么意思
# Configuration file for javax.mail
# If a value for an item is not provided, then
# system defaults will be used. These items can
# also be set in code.
# Host whose mail services will be used
# (Default value : localhost)
mail.host=mail.blah.com
# Return address to appear on emails
# (Default value : username@host)
mail.from=webmaster@blah.net
# Other possible items include:
# mail.user=
# mail.store.protocol=
# mail.transport.protocol=
# mail.smtp.host=
# mail.smtp.user=
# mail.debug=
运行后出现此错误,
Cannot open and load mail server properties file.
Cannot send email. javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
帮助,谢谢