Package anderix.mail

Class EmailMessage

java.lang.Object
anderix.mail.EmailMessage

public class EmailMessage extends Object
  • Constructor Details

    • EmailMessage

      public EmailMessage(String smtpHost, String smtpUser, String smtpPassword)
    • EmailMessage

      public EmailMessage(String smtpHost, int smtpPort, String smtpUser, String smtpPassword)
    • EmailMessage

      public EmailMessage(String smtpHost, int smtpPort, boolean startTLS, String smtpUser, String smtpPassword)
  • Method Details

    • setFrom

      public void setFrom(String name, String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • setFrom

      public void setFrom(String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • addTo

      public void addTo(String name, String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • addTo

      public void addTo(String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • addCC

      public void addCC(String name, String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • addCC

      public void addCC(String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • addBCC

      public void addBCC(String name, String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • addBCC

      public void addBCC(String email) throws javax.mail.internet.AddressException
      Throws:
      javax.mail.internet.AddressException
    • setSubject

      public void setSubject(String subject)
    • setText

      public void setText(String text)
    • attach

      public void attach(File file)
    • send

      public void send() throws javax.mail.MessagingException, IOException
      Throws:
      javax.mail.MessagingException
      IOException
    • send

      public void send(String from, String to, String subject, String text) throws javax.mail.MessagingException, IOException
      Throws:
      javax.mail.MessagingException
      IOException
    • send

      public void send(String from, String to, String subject, String text, File attachment) throws javax.mail.MessagingException, IOException
      Throws:
      javax.mail.MessagingException
      IOException