SMTPAddressFailedException: 550-Verification failed

ich benutze folgenden code für das senden von E-Mails mit java

 function send(){
   String host1 = "domainname";
   String to = "[email protected]";
   String from="[email protected]";
   String subject = "test mail";
   String messageText = "test content";
   boolean sessionDebug = false;
   Properties props = System.getProperties();
   props.put("mail.host", host1);
   props.put("mail.transport.protocol", "smtp");
   Authenticator authenticator = new Authenticator();
   Session mailSession = Session.getInstance(props, authenticator);



       mailSession.setDebug(sessionDebug);
           Message msg = new MimeMessage(mailSession);
   msg.setFrom(new InternetAddress(from));
   InternetAddress[] address = {new InternetAddress(to)};
   msg.setRecipients(Message.RecipientType.TO, address);
   msg.setSubject(subject);
   //msg.setSentDate(new Date());
   msg.setContent(messageText,"text/html");
   Transport.send(msg);
   }
   private class Authenticator extends javax.mail.Authenticator implements java.io.Serializable {
    private PasswordAuthentication authentication;

    public Authenticator() {
         String username = "[email protected]";

        String password = "**********";
        authentication = new PasswordAuthentication(username, password);
    }
    protected PasswordAuthentication getPasswordAuthentication() {
        return authentication;
    }
}

welche gut funktioniert .Aber jetzt brauche ich zum ändern der " von " - Adresse "[email protected]" und ich habe zum senden von E-mails mit den gleichen Authentifizierungsinformationen wie vorher.
wenn ich nur ändern Sie meine Adresse mit der gleichen Authentifizierung erhalte die folgende Fehlermeldung:

exceptionjavax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 550-Verification failed for <someother@domain.com>
550-No Such User Here"
550 Sender verify failed

ist das möglich, zum senden von E-mails mit den gleichen Authentifizierungs-und abweichend von Anschrift.....

Kann einer mir helfen bei der Suche nach dem Problem .....

InformationsquelleAutor ashu | 2012-06-26
Schreibe einen Kommentar