Class Sendmail

  • All Implemented Interfaces:
    Runnable

    public class Sendmail
    extends Object
    implements Runnable
    Class Sendmail - to encapsulate mail sending class as runable thread Copyright by Michael Oberdorf IT-Consulting 2015,
    Date: 2016-07-20
    Version:
    0.200
    Author:
    Michael Oberdorf
    See Also:
    "http://www.oberdorf-itc.de/", "https://www.tutorials.de/threads/email-mit-javamail-versenden.255387/"
    • Constructor Detail

      • Sendmail

        public Sendmail​(String smtpHost,
                        String user,
                        String pass,
                        String senderAddress,
                        String recipientsAddress,
                        String subject,
                        String body)
                 throws javax.mail.internet.AddressException,
                        javax.mail.MessagingException
        Sendmail constructor
        Parameters:
        smtpHost - (String: smtp mail host)
        user - (String: user name for smtp authentication)
        pass - (String: password for smtp authentication)
        senderAddress - (String: the from address)
        recipientsAddress - (String: the recipients address)
        subject - (String: the mails subject line)
        body - (String: the mail body ontent)
        Throws:
        javax.mail.MessagingException - if the properties can't be set
        javax.mail.internet.AddressException - if the mailaddress is rfc822 complient
    • Method Detail

      • run

        public void run()
        run - overwrites the run method to start the tread in background to send the mail
        Specified by:
        run in interface Runnable