If you're using the JRun tag library then you can do something like this:
<jrun:sendmail host="mail.host.com" sender="<%=_sender %>" recipient="<%=_recipient %>"
subject="<%=_subject %>">
Hello world. <br>
<%=_message %>
<jrun:mailparam attachurl="jrun_logo.gif"/>
</jrun:sendmail>
HTH.
Ted Zimmerman
-----Original Message-----
From: G Jeyaraj [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 12:05 AM
To: JRun-Talk
Subject: Re: sending mail with attachments
Hi,
you may use the standard javax.mail apis to send mail with attachments.
like
Message body = new MimeMessage( mailSession );
<...... code to set subject from and to ..........>
Multipart multipart = new MimeMultipart();
<in a loop for multiple files>
BodyPart messageBodyPart = new MimeBodyPart();
String fileName = <the file to be attached (full path)>
DataSource source = new FileDataSource(fileName);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(fileName.substring(fileName.lastIndexOf(separator)+1));
multipart.addBodyPart(messageBodyPart);
<file attachement loop ends>
body.setContent( multipart );
Transport.send( body );
Hope this helps.
jeyaraj
>From: "Tran, Thanh" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: JRun-Talk <[EMAIL PROTECTED]>
>Subject: sending mail with attachments
>Date: Thu, 11 Jul 2002 16:57:07 -0700
>
>Hi,
>
>My server is running JRun 3.1. I have been using jrun taglib to send mail
>out from a jsp script.
>Recently, I need to also include attachments with each email I sent out. I
>don't remember
>seeing an attachment attribute within jrun sendmail taglib. Has anyone
>been
>able to do so or is there a different way to do this?
>
>
>thanks in advance,
>Thanh
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists