I'm using SMTP appender following the example I found.  Setting
setSMTPdebug() proved that I could authenticate.  However, the content seems
to be adverse to the mail host.  I'm using a simple message.  I'd appreciate
any suggestions on how to fix this problem.

I get the following error:

354 Enter mail, end with a single ".".
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type
multipart/mixed; boundary="----=_Part_0_4932403.1165271792368"
   at javax.activation.ObjectDataContentHandler.writeTo (DataHandler.java
:851)
   at javax.activation.DataHandler.writeTo(DataHandler.java:305)
   at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147)
   at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java :1607)
   at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:390)
   at javax.mail.Transport.send0(Transport.java:163)
   at javax.mail.Transport.send(Transport.java:80)
   at org.apache.log4j.net.SMTPAppender.sendBuffer (Unknown Source)
   at org.apache.log4j.net.SMTPAppender.append(Unknown Source)
   at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
   at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(
AppenderAttachableImpl.java:65)
   at org.apache.log4j.Category.callAppenders(Category.java:203)
   at org.apache.log4j.Category.forcedLog(Category.java:388)
   at org.apache.log4j.Category.error(Category.java :302)
   at email.EmailTestForPost.main(EmailTestForPost.java:38)
log4j:ERROR Error occured while sending e-mail notification.
javax.mail.SendFailedException: Sending failed;
 nested exception is:
   class javax.mail.MessagingException: IOException while sending message;
 nested exception is:
   javax.activation.UnsupportedDataTypeException: no object DCH for MIME
type multipart/mixed; boundary="----=_Part_0_4932403.1165271792368"
   at javax.mail.Transport.send0(Transport.java:218)
   at javax.mail.Transport.send(Transport.java:80)
   at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source)
   at org.apache.log4j.net.SMTPAppender.append (Unknown Source)
   at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
   at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders
(AppenderAttachableImpl.java:65)
   at org.apache.log4j.Category.callAppenders (Category.java:203)
   at org.apache.log4j.Category.forcedLog(Category.java:388)
   at org.apache.log4j.Category.error(Category.java:302)
   at email.EmailTestForPost.main(EmailTestForPost.java:38)
0 [main] ERROR EmailTest  - test message body


here's my code with the user/password changed.

public class EmailTestForPost {
   static Logger log;

   public static void main( String[] args ) {

       BasicConfigurator.configure ( );
       log = Logger.getLogger( "EmailTest" );

       SMTPAppender sa = new SMTPAppender( );

       sa.setSMTPHost( "outgoing.verizon.net " );
       sa.setSMTPUsername( "[EMAIL PROTECTED]" );
       sa.setSMTPPassword("password" );
       sa.setFrom(" [EMAIL PROTECTED]" );
       sa.setTo( "[EMAIL PROTECTED]" );
       sa.setSubject( "test message" );

       sa.setSMTPDebug( true );
       sa.activateOptions( );

       PatternLayout layout = new PatternLayout("%m");

       sa.setLayout( layout);
       log.addAppender( sa );

       log.error( "test message body" );
   }
}

Thank you in advance,

Jeff

Reply via email to