首页 > javax.mail send failed: domain isn't in my list of allowed rcpthosts

javax.mail send failed: domain isn't in my list of allowed rcpthosts

package com.gotobus.util.email;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
public class SendMail {

    /**
     * @param args
     */
    public static void main(String[] args) {
        String host = "mail.gotobus.com";   //发件人使用发邮件的电子信箱服务器
        String from = "no-reply@gotobus.com";    //发邮件的出发地(发件人的信箱)
       // String to = "wushu201404@gmail.com";   //发邮件的目的地(收件人信箱)
        String to="2668208858@qq.com";

       Properties props = System.getProperties();
       props.put("mail.smtp.host", host);



   Session session = Session.getDefaultInstance(props,null);

      MimeMessage message = new MimeMessage(session);

        try {
            message.setFrom(new InternetAddress(from));
            message.addRecipient(Message.RecipientType.TO,
              new InternetAddress(to));
            message.setSubject("测试程序--no-reply--!");
            message.setText("这是用java写的发送电子邮件的测试程序99999wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwa!");
            message.saveChanges();

            Transport.send(message);
            System.out.println("=======success=====");
        } catch (AddressException e) {
            e.printStackTrace();
        } catch (MessagingException e) {
            e.printStackTrace();
        }



    }

}

------------抛出异常-----------------

javax.mail.SendFailedException: Invalid Addresses;   nested exception is:   com.sun.mail.smtp.SMTPAddressFailedException: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

------------异常说明-----------------

String To="mark@gotobus.com"//企业内部邮箱可以正常发送
如果String To="2668208858@qq.com"//为QQ邮箱会出现上面的报错。
发件箱是不需要进行身份验证。。。。。
急求高手解决问题!!!!!

【热门文章】
【热门文章】