Commons Email
  1. Commons Email
  2. EMAIL-6

[email] Errors when sending MultiPartEmail with another email as an attachment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      Take a look at the code below:

      if( debugMode ) {
      if( logger.isInfoEnabled() )

      { logger.info( "DEBUG mode is on. Sending email to " + debugEmailAddress ); }

      MultiPartEmail debugEmail = new MultiPartEmail();
      if( logger.isDebugEnabled() )

      { debugEmail.setDebug( true ); }

      debugEmail.setBounceAddress( debugEmailAddress );
      debugEmail.setFrom( debugEmailAddress );
      debugEmail.addReplyTo( debugEmailAddress );
      debugEmail.addTo( debugEmailAddress );
      debugEmail.setSubject( "Test Message: " + email.getSubject() );
      debugEmail.setMsg( "The email manager is operating in test mode. " +
      "Attached is a message it would have sent had it been running for real." );
      debugEmail.addPart( new MimeMultipart(
      new MimePartDataSource( email.getMimeMessage() ) ) );

      debugEmail.setMailSession( emailSession );
      messageId = debugEmail.send();
      }

      I get the following exception when I call debugEmail.send():

      2006-03-12 09:07:01,140 [ main] INFO
      com.djinnsoft.jade.email.EmailManager: DEBUG mode is on. Sending email to
      test@djinnsoft.com
      2006-03-12 09:07:01,640 [ main] WARN
      com.djinnsoft.jade.email.EmailManager: Error emailing sent item 2000035: Sending
      the email to the following server failed : null:25
      javax.mail.SendFailedException: Sending failed;
      nested exception is:
      javax.mail.MessagingException: IOException while sending message;
      nested exception is:
      java.io.IOException: "text/plain" DataContentHandler requires String object,
      was given object of type class javax.mail.internet.MimeMultipart
      at javax.mail.Transport.send0(Transport.java:219)
      at javax.mail.Transport.send(Transport.java:81)
      at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)
      at org.apache.commons.mail.Email.send(Email.java:898)
      at com.djinnsoft.jade.email.EmailManager.processMailing(EmailManager.java:1205)

      (line 1205 corresponds to "messageId = debugEmail.send();" in my code)

        Activity

        Dave Cherkassky created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 38939 12342972
        Henri Yandell made changes -
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Key COM-2820 EMAIL-6
        Affects Version/s 1.0 Final [ 12311651 ]
        Project Commons [ 12310458 ] Commons Email [ 12310474 ]
        Component/s Email [ 12311114 ]
        Henri Yandell made changes -
        Affects Version/s 1.0 Final [ 12311731 ]
        Bjorn Townsend made changes -
        Attachment MultiPartEmailTest.java.patch [ 12343812 ]
        Ben Speakmon made changes -
        Fix Version/s 1.1 [ 12312230 ]
        Assignee Ben Speakmon [ bens ]
        Ben Speakmon made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Siegfried Goeschl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Ben Speakmon
            Reporter:
            Dave Cherkassky
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development