Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question preformatted mailto: email message within javascript

    In one of my web pages, I'm trying to preformat a "mailto:" URL email message (within javascript). When I have my browser (IE 6) email tool set to Outlook Express, the formatting works. When I have my browser email tool set to Yahoo Mail, the formatting is lost. Is ther a way I can get the formatting to work in Yahoo mail, and across all other mail tools?

    I've tried using different character sets (hex, octal, and excape sequences {like \n}, but they all get stripped out. Here is a similar javascript function that I'm using:

    function go(){
    window.location='user@domain.com?subject=Subject text&body=Body text line 1.%0ALine 2.\n';
    }

    Thanks!

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,045
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Try:

    function go(){
    window.location='user@domain.com?subject=' + escape("Subject text") + '&body=' + escape("Body text line 1.\nLine 2.\n");
    }

    Or simply use this tool which does the same thing.

  • #3
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thx for the suggestion, but I had already tried escape(). It makes no difference with Yahoo mail. And escape() essentially converts \n to %0A. Yahoo strips that out.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •