Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFMAIL HELP 1

Status
Not open for further replies.

techninut

Technical User
Joined
Nov 28, 2001
Messages
92
Location
US
I am trying to set up one of my web forms to email a confirmation to one of the fields in my form. I am not sure if this is possible or not, but I know that I have filled out many forms before and received an email confirmation.

Currently I am using a .cfm file to email myself whenever a form is submitted, but I was wondering if there is a way to email the person submitting the form as well. (assuming they enter their email address in the form). If any one has any experience with this and possible some feedback, I would appreciate any help. As well, I was wondering how I could send the information to a number of recipients. Right now I am only able to send it to a (To:) field and a (cc:) field. Here is the .cfm file I am using.

<cfmail from=&quot;admin@remoteclear.com&quot; to=&quot;david.sergile@xxx.com;sergile@xxx.com&quot;subject=&quot;SEB Monitoring Request Form&quot;

server=&quot;63.79.257.23&quot; >
Request Type: #Traffic#
Confirmation email: #confirmemail#
Branch Manager Name: #managerName#
</cfmail>


- David
 
Direct your form page to an acknowledgement page and run the CFMAIL tag from there (which looks like what you are already doing). Assuming you are pulling up your current variables from a database (#Traffic#, #managerName#, etc.) -just add the form field for the email address to your CFQUERY tag. Assuming you named the database column where you store the users email address as email_address:

<CFMAIL
QUERY=&quot;your_query_name;
FROM=&quot;admin@remoteclear.com&quot;
TO=&quot;#email_address#;david.sergile@xxx.com;sergile@xxx&quot;
SUBJECT=&quot;SEB Monitoring Request Form&quot;

server=&quot;63.79.257.23&quot;
Request Type: #Traffic#
Confirmation email: #confirmemail#
Branch Manager Name: #managerName#
</cfmail>

Idealism increases in direct proportion to one's distance from (or ignorance of) the problem.



BT
 
Carl,
Yes I am using a form and not a database andthis is exactly what I am looking for. So am I able to put all the CFMAIL's in the same file ?. And does that 'if' statement basically verify that there is an email in that form field?

Thanks,

- David
 
I set it up but it is not emailing the form field.

this is what I have. If you have any ideas I would appreciate it.


<cfmail from=&quot;admin@clear.com&quot; to=&quot;#form.confirm#&quot; subject=&quot;online form.&quot; server=&quot;163.193.224.123&quot;>


Congratulations. Your online form was submitted successfully !

</cfmail>

<cfmail from=&quot;admin@clear.com&quot; to=&quot;david@hotmail.com,matthew@hotmail.com,#form.confirm#&quot; subject=&quot;#form.hiddenField#&quot;

server=&quot;63.99.224.23&quot; >
Request Type: #form.hiddenField#
Requested by: #form.requestedBy#
Comments: #form.Comments#
Manager Name: #form.managerName#
</cfmail>

<cflocation url=&quot;

- David
 
Do a
Code:
<CFOUTPUT>#FORM.confirm#</CFOUTPUT>
(and comment out the CFLOCATION just for now, so you can see the output display) to make sure FORM.confirm contains what you think it does.

Second thing to check... are you using
Code:
method=&quot;POST&quot;
on the original form tag? That's the only way the values are populated in the FORM scope... otherwise, if you use &quot;GET&quot; (default), they'll be passed on the URL line and be in the URL scope instead.

So make sure you're using:
Code:
<form action=&quot;somepage.cfm&quot; method=&quot;POST&quot; ...>

Finally... couldn't help but notice that you have different servers specified for each email. This is pretty unusual. In general you'd want the CF server to communicate with just one pop server. Did you really want to send it via a different server than the other??


-Carl
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top