Skip to main content
Inspiring
December 12, 2010
Question

<cfmail to="#form.email#" not working

  • December 12, 2010
  • 3 replies
  • 2786 views

I'm Using Coldfusion 9

1. I have an action page entitled Thankyou.cfm. This page i designed to insert information into a database and send two different email to two different people. one email is to be sent to me (and it works just fine). Code is below.

<cfmail
        from="FCSD Home Delivery"
         to="hh@thesonco.com"
        subject="You Have FCSD Home Delivery Request from #form.fname#"
        replyto="#form.email#"
        failto="bnice@ul.edu"
        server="208.112.71.220">
       
A new order from:
Name:  #Trim(FORM.fName)#
Phone: #Trim(FORM.Phone)#
Email: #Trim(FORM.Email)#
Delivery Option: #Trim(FORM.Deliveryoption)#
Comments: #Trim(FORM.CusGet_Updates)#
</cfmail>

2. The other other cfmail (written on the same page) does not send the confirmation email to the customer. The code is below

<cfmail
        from="hh@thesonco.com"
         to="#form.email#"
        subject="Thank You #form.FName#"
        replyto="hh@thesonco.com"
        server="208.112.71.220">
      
Confirmation message goes here
</cfmail>

3. The first cfmail send just fine along with the proper insertion into the database. the second cfmail (written on the same page) never shows up on the customers email (as i had tried using my own separate email address).

Am missing something. All suggestions would be welcome thanks guys...

    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    December 12, 2010

    What happens when you reverse the order and implement the second cfmail tag first?

    Inspiring
    December 13, 2010

    The same email still get emailed to me and the email to the customer still never gets emailed.

    Community Expert
    December 12, 2010

    Does the mail server allow relaying to external domains? You can test this by attempting to connect to the mail server from a telnet session launched from your CF server's console (Google "SMTP telnet" for instructions on how to connect to a mail server via telnet).

    Dave Watts, CTO, Fig Leaf Software

    http://www.figleaf.com/

    http://training.figleaf.com/

    Read this before you post:

    http://forums.adobe.com/thread/607238

    Dave Watts, Eidolon LLC
    Inspiring
    December 13, 2010

    All of you Guys are a great help!!!! I believe that it was a server setting that was on the cfmail being sent to the customer. i removed the server info in My original code:

    <cfmail
            from="hh@thesonco.com"
             to="#form.email#"
            subject="Thank You #form.FName#"
            replyto="hh@thesonco.com"
            server="208.112.71.220">
         
    Confirmation message goes here
    </cfmail>


    To This code

    <cfmail
            from="hh@thesonco.com"
             to="#form.email#"
            subject="Thank You #form.FName#">
         
    Confirmation message goes here
    </cfmail>

    After i did that, cfmail sent the appropiate email to both myself and the customer. I tested it about twice and it worked. I will continue to test it to make sure that it is working properly.

    Thanks again for all of your help!!!

    BKBK
    Community Expert
    Community Expert
    December 15, 2010

    Interesting discovery! I suspect you've touched on something deep here. Could it be that Coldfusion ignores a second cfmail tag with the same server attribute because it doesn't want to reopen an already open server-to-server connection?

    Inspiring
    December 12, 2010

    Is there anything in the undeliverable folder?  Does the mailsent log show that the mail was sent?

    Inspiring
    December 13, 2010

    The Mail log  in my coldfusion administrator is showing all of my

    unsent mail. It will not resend even after i respool in the admin panel.

    Owainnorth
    Inspiring
    December 13, 2010

    I'd guess that as "FCSD Home Delivery" is not a valid email address the email is being rejected somewhere, probably by the client's mail server.