You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Andrew Khoury (JIRA)" <ji...@apache.org> on 2018/04/19 15:58:01 UTC

[jira] [Created] (EMAIL-178) setFrom no longer working

Andrew Khoury created EMAIL-178:
-----------------------------------

             Summary: setFrom no longer working
                 Key: EMAIL-178
                 URL: https://issues.apache.org/jira/browse/EMAIL-178
             Project: Commons Email
          Issue Type: Bug
    Affects Versions: 1.5
            Reporter: Andrew Khoury


setFrom no longer works in commons-email 1.5.  The code below sends the email as the authentication userid email address instead of the from address.  With the code below, the from address works with commons-email 1.2.

{code:none}

public class TestEmailFrom {

public static void main(String [] args) throws EmailException {

String emailFromAddress = "fake.from.address@gmail.com";

String emailToAddress = "fake.to.address@gmail.com";

Email email = new SimpleEmail();

email.setHostName("smtp.gmail.com");

email.setSmtpPort(465);

email.setAuthentication("userid@gmail.com", "password");

email.setSSLOnConnect(true);

email.setFrom(emailFromAddress);

email.setSubject("TestMail");

email.setMsg("This is a test mail ... :-)");

email.addTo(emailToAddress);

email.send();

}

}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)