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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion Mail Form Problem

Status
Not open for further replies.

besnette1

Technical User
Jun 19, 2001
9
Hi there,
I have something that is frustrating me to no end - something simple, I think. If anyone has had this problem and a suggestion I would be grateful!

I am doing a mail form on my site. Very simple. However, when I add a cc field, or a bcc field, it stops working (doesn't send the mail).

This works:

<cfmail>
from="#form.emailaddress#"
to="david@widget.com"
subject="widget.com contact"
server="mail.widget.com"
username="david@widget.com"
password="widgetpassword">

This does not work:

<cfmail>
from="#form.emailaddress#"
to="david@widget.com"
cc="customer@widget.com"
subject="widget.com contact"
server="mail.widget.com"
username="david@widget.com"
password="widgetpassword">

Thank you for taking a look!
 
I'm not sure if the code you provided is exactly what you have coded. If it is make sure that the <cfmail> tag is open until all the attributes are defined as below.

<cfmail from="#form.emailaddress#"
to="david@widget.com"
cc="customer@widget.com"
subject="widget.com contact"
server="mail.widget.com"
username="david@widget.com"
password="widgetpassword">

Hope this helps,
Dino

 
Hi Devon,
Thanks for the speedy suggestion. The problem was actually the
from="#form.emailaddress#"

My hosting company doesn't allow that for authentication - so instead I did this

from="david@widget.com"
to="david@widget.com"
replyto="#form.emailaddress#"
cc="whoever you want"
bcc="whoever you want"
subject="Mail form for widget"

And it works great. I appreciate your effort to help me. Take care!
 
My hosting company doesn't allow that for authentication

That doesn't make any sense. What does authentication by the hosting company have anything to do with from="#form.emailaddress#"?

The CF server will parse #form.emailaddress# into an actual e-mail (as being passed via the FORM scope)

Did you try wrapping the <cfmail> tag around <cftry>/<cfcatch> to see what the actual error returned is?

Ghepetto's comment above makes sense in that if you coded the <cfmail> tag as:
<cfmail>
from="#form.emailaddress#"
to="david@widget.com"
cc="customer@widget.com"
subject="widget.com contact"
server="mail.widget.com"
username="david@widget.com"
password="widgetpassword">

The portion in red will cause the error as you close the <cfmail> tag before you pass any attributes.

_____________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top