0
最近私のメールをGoogle Appsに移動しました。これで、gmail.comのメールアカウントにログインしてメールを送受信できます。JavaMail:Google Appsに転送されたドメインのSMTPメールを送信できません
[email protected]、今、以前のSMTP設定で正常に動作していたSMTPメールを古いホストに送信しようとしています。
は、ここに私のコード
Properties props = new Properties();
props.setProperty("mail.transport.protocol", "smtp");
props.setProperty("mail.host", "smtp.gmail.com");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");
props.put("mail.debug", "true");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
Session session = Session.getDefaultInstance(props, new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("[email protected]", "my-new-password-on-gmail");
}
});
であり、ここで私は
EHLO 192.168.56.1
250-smtp.gmail.com at your service, [xxx.xx.xxx.xx an ip address]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "35882577"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN failed
javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbtb
534-5.7.14 bABxM5_Dmk2f4asdasd86czsyvAdPqDTVjasdasdR2uN3N
534-5.7.14 bZAMByd76RlHwaGfasdasdoMS4pvXFhJOeoGhTwfRXWU2csadasd-zsuhCGiH7LUJsvrP_
534-5.7.14 DGJ_H79hQJlasdasdXNk0q_lRiiSGjDxsum4cZqQ6asdasdasdasdasdefI3-GjhEXGqCi5g
534-5.7.14 fZk_9lOFdPY9asduyernmdfhdfwm-k> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/answer/78754 n13oiuy5458013wmd.3 - gsmtp
at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:826)
at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:761)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:685)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at com.vdif.web.commons.SmtpMailSender.send(SmtpMailSender.java:104)
at com.vdif.web.commons.SmtpMailSender.send(SmtpMailSender.java:33)
at com.vdif.web.commons.SmtpMailSender.main(SmtpMailSender.java:116)
ログインが拒否されました。あなたはAPPへのアクセスを許可しましたか?エラーメッセージのリンクをたどって、そこで推奨されていることを実行してください:https://support.google.com/mail/answer/78754 – Fildor
問題を解決できません。上記の通信を安全にする方法は何ですか?'' C:/ Program Files/Java/jdk1.8.0_60/jre/lib/security/cacerts "' –
openssl s_client -connect smtp.gmail.com:465> sampe.txt そしてこのtxtファイルから私は証明書を分けた –