You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dwayne Walker <wb...@gmail.com> on 2007/07/11 17:26:18 UTC

using loadfile and preserving the file formating.

I have a file that I wanted to load into the body of an email (as
opposed to attaching it) but when I use loadfile then include the
property name in the email message it strips all of the formating.

Is their some way to fix this? or perhaps using filterchain to convert
the linebreaks some how etc... this is also html email so converting
them to <br> would do. any rate does anyone have any suggestions or
ideas?

thanks guys.

<target name="mail" depends="init, ftp" unless="stop_processing"
description="Mail out an email telling folks where the log files are
in the archive and attach the listing file that was downloaded in the
ftp target.">

<loadfile property="listing" srcFile="${tmp}/ftp.listing.txt" />
<mail mailhost="******"
	  messagemimetype="text/html"
	  charset="ISO-8859-1"
	  subject="Daily ****** Application Logs Archive. pulled today
${TODAY} for ${systemPeopleName}"
	  from="*******"
	  tolist="${emailList}"
	  bcclist=""
	  user="*******"
	  password="******" >
			<message>
				<![CDATA[
					<p>This is a listing of the log files downloaded from ***** for
the ${systemPeopleName} WAS application.
					<p>The Log files have been archived on the shared drive at <a
href="${archive_dir}">${archive_dir}</a> in a file named <a
href="${archive_dir}\${zipFileName}">${zipFileName}</a>
					<p>thank you very much and have a nice day.
				
					<p>${listing}
				    ]]>
			    </message>
		</mail>
	</target>


-- 
__________________________________
No matter how responsible he may seem,
Never give your Gun to a Monkey.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: using loadfile and preserving the file formating.

Posted by Andrew Goktepe <an...@gmail.com>.
Have you tried writing the entire message body to a file and then using the
messagefile attribute of <mail>? If you do this then the contents of the
listing file don't need to go through <loadfile>.

-Andrew

On 7/11/07, Dwayne Walker <wb...@gmail.com> wrote:
>
> I have a file that I wanted to load into the body of an email (as
> opposed to attaching it) but when I use loadfile then include the
> property name in the email message it strips all of the formating.
>
> Is their some way to fix this? or perhaps using filterchain to convert
> the linebreaks some how etc... this is also html email so converting
> them to <br> would do. any rate does anyone have any suggestions or
> ideas?
>
> thanks guys.
>
> <target name="mail" depends="init, ftp" unless="stop_processing"
> description="Mail out an email telling folks where the log files are
> in the archive and attach the listing file that was downloaded in the
> ftp target.">
>
> <loadfile property="listing" srcFile="${tmp}/ftp.listing.txt" />
> <mail mailhost="******"
>           messagemimetype="text/html"
>           charset="ISO-8859-1"
>           subject="Daily ****** Application Logs Archive. pulled today
> ${TODAY} for ${systemPeopleName}"
>           from="*******"
>           tolist="${emailList}"
>           bcclist=""
>           user="*******"
>           password="******" >
>                         <message>
>                                 <![CDATA[
>                                         <p>This is a listing of the log
> files downloaded from ***** for
> the ${systemPeopleName} WAS application.
>                                         <p>The Log files have been
> archived on the shared drive at <a
> href="${archive_dir}">${archive_dir}</a> in a file named <a
> href="${archive_dir}\${zipFileName}">${zipFileName}</a>
>                                         <p>thank you very much and have a
> nice day.
>
>                                         <p>${listing}
>                                     ]]>
>                             </message>
>                 </mail>
>         </target>
>
>
> --
> __________________________________
> No matter how responsible he may seem,
> Never give your Gun to a Monkey.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>