Java Sendmail无法打开和加载邮件服务器属性文件
我试图在我的java应用程序中创建一个EmailSender 我为电子邮件制作框架,我用谷歌搜索一些可以帮助我的例子 所以我觉得这首短裙非常有用 但我不明白这种配置是什么意思Java Sendmail无法打开和加载邮件服务器属性文件,java,jakarta-mail,sendmail,Java,Jakarta Mail,Sendmail,我试图在我的java应用程序中创建一个EmailSender 我为电子邮件制作框架,我用谷歌搜索一些可以帮助我的例子 所以我觉得这首短裙非常有用 但我不明白这种配置是什么意思 # 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. # H
# 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
帮帮忙,谢谢