Placing pre-formatted body text into Outlook email?

J

John Kotuby

Hi all,
My ASP.NET 2.0 VB website has "Request More Info" link that opens a web
form and then sends that form via web mail. My customers have asked "Can you
get your site to place that form (along with the SendTo and Subject) into my
Outlook email client so that I have a record of my request?"

I am stuck at a certain point.

I can get the SendTo, and Subject into the email because it doesn't require
any Line Breaks or formatting whatsoever.

Here is a bit of my JavaScript that I am using.
-------------------------------------
function ShowEmail()
{
var eAddr = document.links("contEmail").href
var theLists = document.getElementById("hidListTexts").value;
var arrayLists = theLists.split("~~")
var theBody = ''
if (arrayLists.length > 0)
{
for (var i = 0; i < arrayLists.length; i++)
{
theBody += arrayLists+'\n\r'
}
}
eAddr += '?subject=Please%20Provide%20Information%20About%20These%20Lists'
eAddr += '&amp;body=' + theBody
window.navigate(eAddr)
}
-------------------------------------

I pull the current MailTo HREF from a link on the page (that Address changes
depending on the products the user selects).

Where I get stuck is trying to place a simple list of the user-selected
products separated by line-breaks in the email.
I read an article that recommended placing "\n\r" into a text string created
with Javascript to put a newline/carriage-return into the text.

Outlook seems to be ignoring this approach.

Can anyone help me with a suggestion or a link to information that might
explain how to accomplish what I need?
It doesn't need to be Javascript. Anything that would accomplish the task at
hand would be appreciated.

Thanks for any help in this matter...
 
J

John Kotuby

Thanks Kalpesh,

Works like a charm. I would have never thought of using the hexadecimal
equivalent of CHR(13) in combination with %0 as in %0D.

Thank you so much.

BTW...It didn't work at first because I was concatenating my string in
javascript using + '%0D' instead of "%0D".
Using double quotes seemed to make a difference for me.

Thanks again...

Kalpesh said:
John,

For carriage return, try %0D
mailto:[email protected]?subject=hello&body=hello%0Dworld

Does that work?

Kalpesh

Hi all,
My ASP.NET 2.0 VB website has "Request More Info" link that opens a web
form and then sends that form via web mail. My customers have asked "Can
you
get your site to place that form (along with the SendTo and Subject) into
my
Outlook email client so that I have a record of my request?"

I am stuck at a certain point.

I can get the SendTo, and Subject into the email because it doesn't
require
any Line Breaks or formatting whatsoever.

Here is a bit of my JavaScript that I am using.
-------------------------------------
function ShowEmail()
{
var eAddr = document.links("contEmail").href
var theLists = document.getElementById("hidListTexts").value;
var arrayLists = theLists.split("~~")
var theBody = ''
if (arrayLists.length > 0)
{
for (var i = 0; i < arrayLists.length; i++)
{
theBody += arrayLists+'\n\r'}
}

eAddr +=
'?subject=Please%20Provide%20Information%20About%20These%20Lists'
eAddr += '&amp;body=' + theBody
window.navigate(eAddr)}

-------------------------------------

I pull the current MailTo HREF from a link on the page (that Address
changes
depending on the products the user selects).

Where I get stuck is trying to place a simple list of the user-selected
products separated by line-breaks in the email.
I read an article that recommended placing "\n\r" into a text string
created
with Javascript to put a newline/carriage-return into the text.

Outlook seems to be ignoring this approach.

Can anyone help me with a suggestion or a link to information that might
explain how to accomplish what I need?
It doesn't need to be Javascript. Anything that would accomplish the task
at
hand would be appreciated.

Thanks for any help in this matter...

 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top