cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: Using internal paths for sendmail attachments
Date Thu, 22 Aug 2002 15:42:41 GMT
Paul Pattison wrote:

...

>>>Here is a snippet from the sendmail logicsheet:
>>>
>>>String _sendmail_strSubAttachement;
>>>BodyPart _sendmail_att_part;
>>>DataSource _sendmail_data_source;
>>>
>>>try {
>>>	org.apache.excalibur.source.Source input_source =
>>>resolver.resolve("cocoon:/newsletter.pdf");
>>>
>>>      
>>>
>>Are you on 2.1? I was referring to 203.
>>In 2.1, you should use resolveURI() method.
>>    
>>
>
>I am using 2.1.  I'll switch the method.
>
>  
>
>>>	_sendmail_data_source = new URLDataSource(new
>>>java.net.URL(input_source.getSystemId()));
>>>
>>>      
>>>
>>This should fail with malformed URL exception: unknown
>>protocol cocoon.
>>
>>Vadim
>>    
>>
>
>You say it will fail.  Is there a way to do this then?  Do I have to write
>the pdf to file and then attach it with the FileDataSource?  Any ideas?
>

Can't you attach stream? (i'm not familiar with api you are using)

Vadim


>>>_sendmail_att_part = new MimeBodyPart();
>>>	_sendmail_att_part.setDataHandler(new
>>>      
>>>
>>DataHandler(_sendmail_data_source));
>>    
>>
>>>	_sendmail_att_part.setFileName(_sendmail_data_source.getName());
>>>	_sendmail_multipart.addBodyPart(_sendmail_att_part);
>>>}
>>>catch (Exception e) {
>>>	throw new RuntimeException(e.getMessage());
>>>      
>>>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message