Adding returns to a text email.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Travis_Polland
Posted On:   Thursday, July 19, 2001 09:28 AM

Hi, Here is a simple question, however, being only six inches from my screen, I can not see the answer. :-) I have a JSP page that sends out a JavaMail email. In the body of the email I want to have returns in my string for new paragraphs. How do I do this? <---CODE----> Message newMessage = new MimeMessage(sendMailSession); newMessage.addHeader("X-Priority", request.getParameter("PRIORITY")); newMessage.setFrom(new InternetAddress(request.getParameter("FROMEMAIL"), request.getParameter("FROM"))); String strName = request.getParameter("TO"); Address[] address = (Address[])Internet   More>>

Hi,


Here is a simple question, however, being only six inches from my screen, I can not see the answer. :-)



I have a JSP page that sends out a JavaMail email. In the body of the email I want to have returns in my string for new paragraphs. How do I do this?



<---CODE---->



Message newMessage = new MimeMessage(sendMailSession);

newMessage.addHeader("X-Priority", request.getParameter("PRIORITY"));

newMessage.setFrom(new InternetAddress(request.getParameter("FROMEMAIL"), request.getParameter("FROM")));



String strName = request.getParameter("TO");

Address[] address = (Address[])InternetAddress.parse(strName, false);

newMessage.setRecipients(Message.RecipientType.TO, address);

newMessage.setSubject(request.getParameter("CDID")+ ": "+ request.getParameter("SUBJECT"));

newMessage.setSentDate(new Date());

newMessage.setText("A change was submitted which may impact your organization. Please review ticket#"+ request.getParameter("CDID")+" at "+ request.getParameter("CONCURL")+"/URL.jsp?CDID="+ request.getParameter("CDID")+ " and concur or non-concur with the change. For further assistance please call Change Management at "+ request.getParameter("CHN_PHONE")+ " " + request.getParameter("CHN_WORK_HRS") + " or the Operations Center after 4:00 PM (MST).");



<---END CODE--->



Thanks,

Travis Polland

   <<Less

Re: Adding returns to a text email.

Posted By:   John_Zukowski  
Posted On:   Thursday, July 19, 2001 01:37 PM

First, before asking a question, simplify the problem. Your issue is really neither a JavaMail problem or a JSP issue. You are basically asking, how do I place returns/new lines/carriage returns in a string. Right?


is a newline.
is a carriage return.

About | Sitemap | Contact