Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CFMAIL Problem

    Hi, im having a problem with cfmail. I have a field in my database that will
    contain my email message. So i would like to call that message from cfmail and
    have it formated in html and use the coldfusion tags. like this: <cfmail
    to='#form.payer_email#' cc='#getsettings.email_cc_copy#'
    from='#getsettings.email_from_name#'
    subject='#getsettings.payment_email_subject#'
    server='#getsettings.mail_server#' username='#getsettings.mail_username#'
    password='#getsettings.mail_password#' type='html'>
    #getsettings.email_message# </cfmail> here is whats in the database field:
    (the email message) Dear #form.first_name# #form.last_name#,<br><br> Thank you
    for purchasing #getpart.product_name#!<br> <br> Below is some information on
    how to pick up your purchase....<br> <br> Please visit <a
    href='#getsettings.website_path#'>#getsettings.web site_path#</a> and enter the
    following:<br> <br> Username: #form.payer_email#<br> Password: #password#<br>
    <br> Once logged in click the 'Download' link next to your purchase to
    download. <br><br> We hope you enjoy #getpart.product_name#! If you have any
    questions or problems using your product you can<br> email us at
    #getsettings.support_email# or visit our support forums online at
    #getsettings.your_domain#.<br><br> Sincerely,<br> Tony Paolillo<br>
    #getsettings.support_email#<br> #getsettings.your_domain#<br><br><br> The
    problem is that when it sends the email it sends the message as plain text and
    the ## tags are not formated. Actually it looks just like i pasted it above,
    with no formating. How can i call a field from the db and have it HTML
    formated and use the coldfusion tags? p.s. i even tried this: <cfset
    emailmessage = '#getsettings.email_message#'> and just called #emailmessage#,
    had no luck. Thanks Tony

    TonyP Guest

  2. Similar Questions and Discussions

    1. CFMAIL problem - every nth message disappears
      ISP is running CF 4, 5, 1, SP2 Discovered a problem recently whereby every 12th message sent from a list never arrives, have been using the same...
    2. Problem evaluating text from within a cfmail tag usingthe query parameter
      Hi I'm trying to decrypt a string using text returned from a query and wondered if anyone knows what I need to do... I've tried adding <pre>...
    3. Problem with # and CFMAIL
      Hi, I'm trying to send an html email which has #s in it and it interferes with CFMAIL tags and doesn't work. How can I work aroung this? ...
    4. CFMAIL error problem with invalid email
      Hi, I am having a problem on CF 7. I query through my database to send a mail shot. The problem is if a email address is not correctly formatted...
    5. cfmail - Attribute validation error for tag CFMAIL.
      I'm getting the error ' Attribute validation error for tag CFMAIL.' on the code below. All its doing is outputting a text string to the TO: field. ...
  3. #2

    Default Re: CFMAIL Problem

    Does this happen with all e-mail recipients? If a recipient's e-mail server is not set up to process HTML, you'll get the results you showed.
    jdeline Guest

  4. #3

    Default Re: CFMAIL Problem

    Yes, it happens to all email. Then if i replace the #getsettings.email_message# with the actual message it works fine. I just cant get it to format it if i pull it from the db.

    Tony
    TonyP Guest

  5. #4

    Default Re: CFMAIL Problem

    What you're looking for is the Evaluate() function.

    <cfset foo = "Foo String">
    <cfset bar = "Foo string is : #foo#">
    <cfoutput>#evaluate("bar")#</cfoutput>

    Note the quotes around bar. To do what you want, replace:
    #getsettings.email_message#
    in your cfmail body to:
    #evaluate("getsettings.email_message")#

    Kronin555 Guest

  6. #5

    Default Re: CFMAIL Problem

    Thanks Kronin, that seemed to format the HTML now. But i still cant get the CF
    tags to format. Here is what i have now: <cfmail to='#form.payer_email#'
    cc='#getsettings.email_cc_copy#' from='#getsettings.email_from_name#'
    subject='#getsettings.payment_email_subject#'
    server='#getsettings.mail_server#' username='#getsettings.mail_username#'
    password='#getsettings.mail_password#' type='html'>
    #evaluate('getsettings.payment_email')# </cfmail> and the email comes in like
    this: Dear #form.first_name# #form.last_name#, Thank you for purchasing
    #getpart.product_name#! Below is some information on how to pick up your
    purchase.... Please visit #getsettings.website_path# and enter the following:
    Username: #form.payer_email# Password: #password# Once logged in click the
    'Download' link next to your purchase to download. We hope you enjoy
    #getpart.product_name#! If you have any questions or problems using your
    product you can email us at #getsettings.support_email# or visit our support
    forums online at #getsettings.your_domain#. Sincerely, Tony Paolillo
    #getsettings.support_email# #getsettings.your_domain# Notice the HTML is gone
    now, but the CF tags are still unformated. I even put <cfoutput> tags before
    and after the message to see if that would format it. Tony

    TonyP Guest

  7. #6

    Default Re: CFMAIL Problem

    Any Ideas?
    TonyP Guest

  8. #7

    Default Re: CFMAIL Problem

    How about #evaluate(DE(getsettings.payment_email))#

    - Zoe
    zoeski80 Guest

  9. #8

    Default Re: CFMAIL Problem

    That worked! Thank you very much. Now i will learn what the DE is.

    Thanks Again

    Tony
    TonyP Guest

  10. #9

    Default CFMAIL problem

    Hi everibody,
    I am having problem with cfmail

    I have form where user is uploading file on the server, once file is uploaded
    I am sending mail to administrator and file is attached. I have problem with
    files with spaces in the name IE.?my long file.DOC? File is uploaded on the
    server but mail is not sent, In mail.log file I have error 400. Does anyone
    have solution to this, I can rename file once is uploaded and change spaces
    with ?_? or something, but I would like to know if there is workaround on this.
    I am attaching file with cmailparam.

    Thanks


    Buda123 Guest

  11. #10

    Default Re: CFMAIL problem

    Consider using the URLEncodedFormat() function on your filename.

    <CFSET name = URLEncodedFormat("my long file.DOC")>



    jdeline Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139