Solved

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

Posted on 2007-04-02
4
15,868 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

628 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