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 20:50:00 UTC
[jira] [Resolved] (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 resolved EMAIL-178.
---------------------------------
Resolution: Invalid
Fix Version/s: 1.5
Nevermind, this is invalid. I guess GMail doesn't allow you to set the from address to anything other than the authenticated user. I tested with a relay server and it worked fine.
> 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
> Fix For: 1.5
>
>
> 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)