]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
moved to jmailer-ee project
authorRoland Haeder <roland@mxchange.org>
Mon, 14 Mar 2016 21:47:05 +0000 (22:47 +0100)
committerRoland Haeder <roland@mxchange.org>
Mon, 14 Mar 2016 21:47:05 +0000 (22:47 +0100)
src/java/org/mxchange/jmailee/model/delivery/JobsEmailDeliveryMessageBean.java

index a912f53f9cfbdbf72868f87eda01b83026617850..11f421c9f05ae9b8c22a1d458fa3628333834eb3 100644 (file)
@@ -18,19 +18,12 @@ package org.mxchange.jmailee.model.delivery;
 
 import java.io.Serializable;
 import java.text.MessageFormat;
-import java.util.Date;
-import javax.annotation.Resource;
 import javax.ejb.ActivationConfigProperty;
 import javax.ejb.MessageDriven;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageListener;
 import javax.jms.ObjectMessage;
-import javax.mail.MessagingException;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -48,12 +41,6 @@ import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
 })
 public class JobsEmailDeliveryMessageBean implements MessageListener {
 
-       /**
-        * Email session
-        */
-       @Resource (name = "jmail/jjobs")
-       private Session jmailjjobs;
-
        /**
         * Logger bean
         */
@@ -126,28 +113,4 @@ public class JobsEmailDeliveryMessageBean implements MessageListener {
                this.loggerBeanLocal.logTrace("onMessage: EXIT!"); //NOI18N
        }
 
-       /**
-        * Sends an email to given email address with subject line.
-        * <p>
-        * @param emailAddress Email address for recipient
-        * @param subjectLine  Subject line
-        * @param body         Body part
-        * <p>
-        * @throws NamingException    If the resource cannot be found
-        * @throws MessagingException If something happened on message delivery
-        */
-       private void sendMail (final String emailAddress, final String subjectLine, final String body) throws NamingException, MessagingException {
-               // Get MIME message instance
-               MimeMessage message = new MimeMessage(this.jmailjjobs);
-
-               // Set subject, recipients and body
-               message.setSubject(subjectLine);
-               message.setRecipients(javax.mail.Message.RecipientType.TO, InternetAddress.parse(emailAddress, true));
-               message.setSentDate(new Date());
-               message.setText(body);
-
-               // Directly send email
-               Transport.send(message);
-       }
-
 }