SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Jul 2008
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to add HTML code to format in CFMAIL

    Hello,
    I am a newbie to CFMAIL and like to ask if there is a way to format the output within CFMAIL. I tried to enter HTML code within CFMAIL and I got the html code from output.

    I created a simple comments form for users to submit their comments, and send this result to my email.

    Here is my code:

    <CFMAIL TO = "test@test.com"
    FROM = "test@test.com"
    SUBJECT = "test"
    >

    New suggestions: <br />
    <b>Name/b> #name#
    <b>Comments/b> #comments#
    </CFMAIL>

    On the output, I received all html code and when a user enter multiple rows of suggestions, they are not aligned properly in the email.

    How do I format the output within cfmail?
    How do I get good format for the comments with multiple rows?

    Thanks very much.

    Jenny.

  2. #2
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Jenny,
    Sorry if my reply is too late.

    First you need to set the CFmail type to HTML

    <CFMAIL TO = "test@test.com"
    FROM = "test@test.com"
    SUBJECT = "test"
    type="html"
    >

    Now inside here you can just write html.

    </CFMAIL>

    A good point to remember is that not all mail programs handle html emails the same way and especially with Outlook2007 it is much safer to put inline styles such as <p style="Font=blah"></p>

    Cheers

    Tim

  3. #3
    Non-Member
    Join Date
    Jul 2008
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks. It worked.


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
  •