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] [Updated] (EMAIL-178) setFrom no longer working

     [ https://issues.apache.org/jira/browse/EMAIL-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Khoury updated EMAIL-178:
--------------------------------
    Description: 
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();

}

}
{code}

  was:
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();

}

}


> 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
>            Priority: Major
>
> 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();
> }
> }
> {code}



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