Package com.zeonfederated.mailclient.senders

Examples of com.zeonfederated.mailclient.senders.SmtpSender


    pack();
  }
 
  private void sendMail() {
    // Eigene Implementation:
    Sender sender = new SmtpSender(config.get("send.host", "localhost"), Integer.parseInt(config.get("send.port", "25")));
   
    // Javamail:
    // Sender sender = new JavamailSender(config.get("send.host", "localhost"), Integer.parseInt(config.get("send.port", "25")));
    Message msg = new Message();
   
    msg.setFrom(config.get("my.name") + " <" + config.get("my.email") + ">");
    msg.setTo(to.getText() + ", " + cc.getText());
    msg.setBcc(bcc.getText());
    msg.setSubject(subject.getText());
    msg.setBody(body.getText());
    msg.setSentDate(new Date());
   
    if(! sender.connect()) {
      statusTxt.setText("Konnte mit dem Mailhost nicht verbinden");
      return;
    }
   
    if(sender.send(msg)) {
      sender.close();
    } else {
      statusTxt.setText("Konnte die Nachricht nicht absenden");
      return;
    }
View Full Code Here

TOP

Related Classes of com.zeonfederated.mailclient.senders.SmtpSender

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.