You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2006/03/12 15:20:02 UTC

DO NOT REPLY [Bug 38939] New: - Errors when sending MultiPartEmail with another email as an attachment

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939

           Summary: Errors when sending MultiPartEmail with another email as
                    an attachment
           Product: Commons
           Version: 1.0 Final
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: major
          Priority: P2
         Component: Email
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: dcherk@djinnsoft.com


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)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939





------- Additional Comments From dcherk@djinnsoft.com  2006-03-12 14:31 -------

More information:
The "real" email is an instance of HTMLEmail, like so:
  HtmlEmail email = new HtmlEmail();
  email.setFrom( "a@b.c" );
  email.setBounceAddress( "a@b.c" );
  email.addReplyTo( "a@b.c" );
  email.addTo( "a@b.c" );
  email.setSubject( "subject" );
  email.setTextMsg( "textBody" );
  email.setHtmlMsg( "<p>htmlBody</p> );

I've added the following lines:

 email.addHeader( "Content-Type", "multipart/mixed" );
and
 debugEmail.addHeader( "Content-Type", "multipart/mixed" );


Now my exception is:
javax.mail.SendFailedException: Sending failed;
 nested exception is:
  javax.mail.MessagingException: IOException while sending message;
 nested exception is:
  java.io.IOException: javax.mail.MessagingException: No inputstream from datasource
  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)





-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - [email] Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939





------- Additional Comments From dennisl@apache.org  2007-04-23 14:48 -------
Commons has moved from Bugzilla to JIRA, so this issue can now be found at:
https://issues.apache.org/jira/browse/EMAIL-6

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - [email] Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939


dion@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From dion@apache.org  2006-03-16 09:07 -------
Looks like a clash somewhere with the embedded email.
A test case would be good, taken from the code below.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939





------- Additional Comments From dcherk@djinnsoft.com  2006-03-12 14:47 -------

One final note:  I confirmed that "real" email can be sent by itself.  The error
is definitely happening because I'm trying to add the real email as an
attachment in the debug email.

Please confirm and help :)

Thanks,
Dave Cherkassky

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - [email] Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939


gudnabrsam@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Errors when sending         |[email] Errors when sending
                   |MultiPartEmail with another |MultiPartEmail with another
                   |email as an attachment      |email as an attachment




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - [email] Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939





------- Additional Comments From dcherk@djinnsoft.com  2006-03-25 15:17 -------

Is there an ETA for the fix?  My client deliverable is fast approaching -- I
need to know if I need to write a work-around...

No rush, I just need to know the situation...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - [email] Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939





------- Additional Comments From rpm_mailbox@yahoo.com.br  2007-04-23 14:28 -------
Created an attachment (id=20024)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20024&action=view)
A test case for Bug 38939

Please, read the comments.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 38939] - [email] Errors when sending MultiPartEmail with another email as an attachment

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38939>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38939





------- Additional Comments From rpm_mailbox@yahoo.com.br  2007-04-23 14:29 -------
(From update of attachment 20024)
Hello,

I'm posting a unit test for this bug. I just tried to rewrite the code Dave
showed us in the unit test. I notice that a NullPointerException is thrown when
the method Email.buildMimeMessage() isn't invoked before we call the
Email.getMimeMessage(). I don't know the reason but it sounded weird to me.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org