我正在尝试从Java程序发送邮件。当我尝试发送邮件时,我收到此错误:
javax.mail.MessagingException: Could not connect to SMTP host: smtps.pec.aruba.it, port: 465;
nested exception is:
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
这是我的配置文件:
mail.smtp.host=smtps.pec.aruba.it
mail.smtp.socketFactory.port=465
mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
mail.smtp.auth=true
mail.smtp.ssl.enable=true
mail.smtp.socketFactory.fallback=false
mail.smtp.port=465
mail.mime.charset=ISO-8859-15
nomeutente=my_user
password=my_pass
from-address=my_email_address
from-name=my_name
我已经看到,如果我尝试从Gmail应用程序(我的Android手机)访问此帐户,则只有在我选择SSL / TLS协议而不是STARTLS的情况下,它才有效