1 31 32 package org.opencms.mail; 33 34 import org.opencms.main.CmsLog; 35 36 import javax.mail.MessagingException ; 37 38 import org.apache.commons.logging.Log; 39 import org.apache.commons.mail.Email; 40 41 51 public class CmsMailTransport extends Thread { 52 53 54 private static final Log LOG = CmsLog.getLog(CmsMailTransport.class); 55 56 57 private Email m_email; 58 59 64 public CmsMailTransport(Email email) { 65 66 m_email = email; 67 } 68 69 72 public void run() { 73 74 try { 75 m_email.send(); 76 } catch (MessagingException e) { 77 if (LOG.isErrorEnabled()) { 78 LOG.error(Messages.get().getBundle().key(Messages.LOG_SEND_MAIL_ERR_0), e); 79 } 80 } 81 } 82 83 87 public void send() { 88 89 start(); 90 } 91 } 92 | Popular Tags |