Placing pre-formatted body text into Outlook email?

Discussion in 'ASP .Net' started by John Kotuby, Jan 28, 2008.

  1. John Kotuby

    John Kotuby Guest

    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...
     
    John Kotuby, Jan 28, 2008
    #1
    1. Advertising

  2. John Kotuby

    Kalpesh Guest

    John,

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

    Does that work?

    Kalpesh

    On Jan 28, 6:02 pm, "John Kotuby"
    <> wrote:
    > 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...
     
    Kalpesh, Jan 28, 2008
    #2
    1. Advertising

  3. John Kotuby

    John Kotuby Guest

    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" <> wrote in message
    news:...
    > John,
    >
    > For carriage return, try %0D
    > mailto:?subject=hello&body=hello%0Dworld
    >
    > Does that work?
    >
    > Kalpesh
    >
    > On Jan 28, 6:02 pm, "John Kotuby"
    > <> wrote:
    >> 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...

    >
     
    John Kotuby, Jan 28, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wladimir Borsov
    Replies:
    7
    Views:
    479
    Raymond Loman
    May 5, 2004
  2. David Schwartz

    how to handle pre-formatted text

    David Schwartz, Apr 15, 2008, in forum: XML
    Replies:
    5
    Views:
    575
    Joseph J. Kesselman
    Apr 16, 2008
  3. GriffithsJ

    Pre-formatted text

    GriffithsJ, Feb 3, 2004, in forum: ASP General
    Replies:
    2
    Views:
    153
    Chris Barber
    Feb 3, 2004
  4. Dung Ping
    Replies:
    1
    Views:
    140
    Randy Webb
    Feb 27, 2005
  5. Replies:
    9
    Views:
    449
Loading...

Share This Page