Uploaded image for project: 'Commons Email'
  1. Commons Email
  2. EMAIL-178

setFrom no longer working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Labels:
      None

      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.

      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();
          }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              akhoury Andrew Khoury
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: