メールサーバーを立てておりますが、メールソフトでは、送受信できるのですが、サーブレットでは、できません。
エラーメッセージ
javax.mail.AuthenticationFailedException: 535 5.7.8 Error: authentication failed
mailサーバー mail.sexydesign.club
port 587
接続の保護 STARTTLS
認証方式 通常のパスワード認証
パスワードの認証が、うまくいっていないのかと思いますが、具体的にどの部分がおかしいのか、わかりません。
java
1 Properties property = new Properties(); 2 property.put("mail.smtp.host","mail.sexydesign.club"); 3 property.put("mail.smtp.port", 587); 4 property.put("mail.smtp.starttls.enable", "true"); 5 property.put("mail.smtp.auth", "true"); 6// property.put("mail.smtp.ssl.trust", "mail.sexydesign.club"); 7 Session session = Session.getInstance(property, new myAuth()); 8 MimeMessage mimeMessage = new MimeMessage(session);
java
1 class myAuth extends Authenticator{ 2 protected PasswordAuthentication getPasswordAuthentication() { 3 return new PasswordAuthentication("akirasada1972@sexydesign.club","mypasswd"); 4 } 5 } 6
回答1件
あなたの回答
tips
プレビュー