[問題] javamail問題
小弟 程式碼如下
InternetAddress[] address = null ;
final String charset="big5";
String mailserver = "mail.gameflier.com.tw";
String From = "xyz@mail.gameflier.com.tw";
String to = Email;
String Subject = "TEST";
String messageText = "TEST";
String name = Friend;
final String UserName="Acc";
final String password="password";
boolean sessionDebug = false;
try {
sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();
// 設定所要用的Mail 伺服器和所使用的傳送協定
java.util.Properties props = System.getProperties();
props.put("mail.host",mailserver);
props.put("mail.transport.protocol","smtp");
Authenticator auth = new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(UserName, password);
}
};
// 產生新的Session 服務
javax.mail.Session mailSession =
javax.mail.Session.getDefaultInstance(props,auth);
mailSession.setDebug(sessionDebug);
Message msg = new MimeMessage(mailSession);
// 設定傳送郵件的發信人
InternetAddress ia = new InternetAddress(From);
ia.setPersonal(name, "Big5");
msg.setFrom(ia);
// 設定傳送郵件至收信人的信箱
address = InternetAddress.parse(to,false);
msg.setRecipients(Message.RecipientType.TO, address);
// 設定信中的主題
msg.setSubject("=?Big5?B?"+enc.encode(Subject.getBytes())+"?=");
// 設定送信的時間
msg.setSentDate(new Date());
// 設定傳送信的MIME Type
msg.setText(messageText);
// 送信
Transport trans = mailSession.getTransport("smtp");
trans.connect(mailserver , UserName , password);
trans.send(msg , msg.getAllRecipients());
trans.close();
System.out.println("郵件己順利傳送");
}
catch (MessagingException mex) {
mex.printStackTrace();
}
執行後,卻會出現錯誤~
com.sun.mail.smtp.SMTPSendFailedException: 554 5.7.1 Rejected:
your IP address is listed in the zen.spamhaus.org RBL
想請問這邊的大大們,這個錯誤訊息是什麼意思~
或者是說 我的程式哪裡有錯誤~~
謝謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.166.50.89
推
03/02 18:33, , 1F
03/02 18:33, 1F
→
03/02 18:50, , 2F
03/02 18:50, 2F
→
03/05 12:32, , 3F
03/05 12:32, 3F
推
03/05 12:35, , 4F
03/05 12:35, 4F
→
03/05 12:41, , 5F
03/05 12:41, 5F
討論串 (同標題文章)