Solved

html mailto question - how can I format the email body?

Posted on 2007-04-02
4
15,342 Views
Last Modified: 2008-05-14
I have a mailto: link on my jsp page where I want to automatically populate the email subject and body.

mailto:<user Name>?subject=sub&body=<%= template %>

The mailto DOES open my email client and populate the subject and body.
However, the text in the body is not formatted.

Even though I use "\n" in my text, the line breaks do not happen.
Please let me know how I can do text formatting. Also is it possible to do bold or underline?
thank you.
0
Comment
Question by:mytilig
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 30

Expert Comment

by:Mayank S
ID: 18839083
>> Even though I use "\n" in my text, the line breaks do not happen.

What is displayed instead of the new line?

Maybe try specifying the text as HTML:

<HTML>.... mail contents ....</HTML>

Try using <BR> for line breaks, <BOLD> etc for bold fonts. But I am not sure if this will work.
0
 

Author Comment

by:mytilig
ID: 18839216
It is simply ignoring the \n characters. all the text appear together.
html tags like <br> does not work.
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 250 total points
ID: 18840229
Within the body use "%0A" for a new line,
use "%0A%0A" for a new line preceded by a blank line (paragraph),
see example below.
<a href="mailto:astark1@unl.edu?&body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.">
0
 
LVL 9

Assisted Solution

by:fuzzboxer
fuzzboxer earned 250 total points
ID: 18840242
You need to use URL Encoding.  For instance, if you wanted spaces you would have to use %20 in between you items.

Use this tool to get the results you want:  http://www.w3schools.com/tags/ref_urlencode.asp
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CSS style formatting? 2 30
collection output issue 9 59
dynamic created check uncheck boxes 6 41
HTML5 storage and web apps 11 44
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question