Hmm, very strange. I had the exact same error as Mick yesterday.
I'm also using \n and I was pulling it in from resource bundles but
the breaks were being ignored.
Perhaps it has to do with the mailer. My mailer is setting the type of
message to "text/html" as you can see by my send method below.
public static void send( String replyTo, String to, String subject,
String body )
throws NamingException, AddressException, MessagingException {
InitialContext ic = new InitialContext( );
Session session = ( Session ) ic.lookup( JNDINames.MAIL_SESSION
);
javax.mail.Message msg = new MimeMessage( session );
msg.setReplyTo( InternetAddress.parse(replyTo,false) );
msg.setRecipients( javax.mail.Message.RecipientType.TO,
InternetAddress.parse( to, false ) );
msg.setSubject( subject );
msg.setDataHandler( new DataHandler( body, "text/html" ) );
msg.setHeader( "X-Mailer", "JavaMailer" );
msg.setSentDate( new Date( ) );
Transport.send( msg );
}
The way I fixed this Mick was by using <br> tags instead of /n, so
this perhaps indicates that it's because our mails are set to type html.
However it would be nice to find out if this is the reason!
Hth,
Brian
-----Original Message-----
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: 15 October 2003 15:09
To: 'Struts Users Mailing List'
Subject: AW: [OT]formatting line breaks and tabs in emails?
Yes, I use it in property-files.
-----Urspr�ngliche Nachricht-----
Von: Brian McSweeney [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 15. Oktober 2003 18:08
An: 'Struts Users Mailing List'
Betreff: RE: [OT]formatting line breaks and tabs in emails?
Are the "\n" values being pulled in from resource bundles?
-----Original Message-----
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: 15 October 2003 14:57
To: 'Struts Users Mailing List'
Subject: AW: [OT]formatting line breaks and tabs in emails?
I using \n as line breaks in mails and it functions.
-----Urspr�ngliche Nachricht-----
Von: Mick Knutson [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 15. Oktober 2003 16:51
An: struts
Betreff: [OT]formatting line breaks and tabs in emails?
I am trying to format email messages that need to contain line breaks,
and tabs. But when I add \n\r or \t, they just seems to be ignored.
Is there a way to do this?
---
Thanks
Mick Knutson
The world is a playground...Play Hard, Play Smart.
Visit http://www.YourSoS.com to learn how our "Personal Emergency Alert
& Contact System" can help you Play Smart.
+00 1 (708) 570-2772 Fax
MSN: mickknutson
ICQ: 316498480
ICQ URL: http://wwp.icq.com/316498480
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]