SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    open email with html in the body

    I am quite new to coldfsion, coming from a more asp/php background.

    I have a page which loops through a recordset, putting the information in a table. I want the user to be able to click a link which opens a new email with the same table in the body of the email, but DOES NOT send it.

    Question 1: My idea is to build a variable with the table and contents in - this can then be output to the page and reused in the mailto tag. What is the best way to build this variable with the query loop and some cfif statement thrown in aswell? Do I need to keep re concatinating within each if statement?

    Question 2: how do I get the table to display in the email rather than the raw html?

    Cheers for any suggestions.

    monkey
    monkey - the rest is history

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Wallingford, CT
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by boxhead View Post
    I am quite new to coldfsion, coming from a more asp/php background.

    I have a page which loops through a recordset, putting the information in a table. I want the user to be able to click a link which opens a new email with the same table in the body of the email, but DOES NOT send it.

    Question 1: My idea is to build a variable with the table and contents in - this can then be output to the page and reused in the mailto tag. What is the best way to build this variable with the query loop and some cfif statement thrown in aswell? Do I need to keep re concatinating within each if statement?

    Question 2: how do I get the table to display in the email rather than the raw html?

    Cheers for any suggestions.

    monkey
    I am slightly confused by your first question but for your second question simply put cfmail type="html"

  3. #3
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just re-read it and it is a bit confusing!

    Forget the first question, I can work something out.

    On the second however, I DO NOT want to send the message - I just want to open an email from the users client (outlook etc) with the table in the body of the email. Looking at it again, i think this may be an html question rather than coldfusion, unless cf can do it?

    cheers

    monkey
    monkey - the rest is history

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Wallingford, CT
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by boxhead View Post
    just re-read it and it is a bit confusing!

    Forget the first question, I can work something out.

    On the second however, I DO NOT want to send the message - I just want to open an email from the users client (outlook etc) with the table in the body of the email. Looking at it again, i think this may be an html question rather than coldfusion, unless cf can do it?

    cheers

    monkey
    Oh okay. Well then I am not sure... that does sound like HTML or JavaScript actually opening a mailto: link with document.write commands.

  5. #5
    SitePoint Guru downtroden's Avatar
    Join Date
    Dec 2004
    Location
    illinois
    Posts
    978
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if this is even possible…*I think it's going to be a windows only thing. If your user is on a Mac or Linux, it's not going to work. mailto: anchors just weren't designed to do what you're wanting it to do.
    your brain reacts in the same way whether you are
    looking at something or thinking about it...

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Wallingford, CT
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by downtroden View Post
    if this is even possible…*I think it's going to be a windows only thing. If your user is on a Mac or Linux, it's not going to work. mailto: anchors just weren't designed to do what you're wanting it to do.
    It is totally possible. I have seen it before plenty of times. And as for it working on Mac it would just open up in the Mail app. I don't know about Linux. Does Linux generally have a E-Mail app built in?

  7. #7
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tbh I don't care about mac (spit) users!

    Seriously though, this is an internal system and we only use windows machines.

    When using the 'body' part of the mailto, is there a limit to how long it can be? I think there may also be an issue with it being over several lines?

    cheers
    monkey
    monkey - the rest is history

  8. #8
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Wallingford, CT
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by boxhead View Post
    tbh I don't care about mac (spit) users!

    Seriously though, this is an internal system and we only use windows machines.

    When using the 'body' part of the mailto, is there a limit to how long it can be? I think there may also be an issue with it being over several lines?

    cheers
    monkey
    I do believe that that would depend on your Microsoft Exchange server (if you use Microsoft Exchange). Talk to whom ever manages your email system about size limitations.


Bookmarks

Posting Permissions

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