2012-10-11 44 views
0

我開發的代碼從我的域名發送郵件到gmail.com出現SSLHandshakeException在郵件發送代碼

我得到一個SSLHandshakeException(見下文)。
如何解決這個問題?

Exception in thread "main" javax.mail.MessagingException: Could not convert socket to TLS; 
    nested exception is: 
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: 
    PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
    unable to find valid certification path to requested target 
+1

服務器上是否有防火牆設置? –

+0

評論在這個問題的答案可能會有所幫助:http://stackoverflow.com/questions/12743846/unable-to-send-an-email-using-smtp-getting-javax-mail-messagingexception-could –

回答

-1

您未使用SSL,而是嘗試使用普通身份驗證發送郵件,而您需要SSL身份驗證訪問。