<CFMAIL> Tag - ColdFusion
>> Return to ColdFusion Tag Index
The <CFMAIL> tag allows you have your web site send email.
<CFMAIL> Comments from Macromedia LiveDocs
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
If you use spoolEnable="no" in the cfmail tag, this will allow you upload the attached file from the temp directory and delete after the email has been sent so you don't need to store the file on your server:
<cffile action="upload" filefield="image_upload" destination="C:\temp" accept="image/jpeg, image/pjpeg, image/jpg, image/gif" nameconflict="makeunique" />
<cfmail to="address@company.com" from="#sender#" subject="file attachment" spoolEnable="no">
mail message
<cfmailparam file = "C:\temp\#file.serverfile#" disposition="attachment" />
</cfmail>
<cffile action="delete" file="C:\temp\#file.serverfile#" />
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Hi,
Can anyone help with this?Its the same problem as justjohn below:
Upload a file from a form. Store it in any directory. In the same page, then create a CFmail, and attachement the uploaded file(works just fine). Then after the cfmail call, delete the attached file in your temp directory. You will find that the cfmail will not have ample time to process, before the deletion process:
The following code works fine until I try and delete the uploaded file
from the directory: -
Any ideas to get arounf this would be great:
Thanks
<cfif isdefined ("form.upload_now")>
<cffile action="upload" filefield="ul_path" destination="C:\test\" nameconflict="makeunique" accept="*/*">
Your file was successfully uploaded!
<cfmail type="html" to="ligra@sunlife.com" from="ligra@sunlife.com" subject="Testing attach" >
<cfmailparam file="#ServerDirectory#\#ServerFile#" type="*/*">
<a href="mailto:ligra@sunlife.com?subject=test subject line">Click here to reply</a>
</cfmail>
</cfif>
<!--- <cffile action="delete" file="#ServerDirectory#\#ServerFile#"> --->
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
One more interesting note, if you look closely at the headers in the mails/failed mails, you can see that the cfmail tag (engine) reports the cf version is 4.5.0 So the cfmail tag is very likely the same as the 4.5 version...which sounds about right from what I remember of it from then.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
well, as you have all figured out, cfmail gets a great overhaul later in 6 (in particular the user/pwd properties). currently, 5 has some serious limits. if you can deal with them, it works pretty well.
1) needs to be a local host or gateway server to send to most recipients these days as most mail servers won't pass mail through. this is 'usually' the case for most hosts, and if you have your own dedicated server, you can set it up that way.
2) yes, we have all seen that if the mail fails, you don't get much notification...you can parse the logs on the server (if you have access [default is c:\cfusion\log\mail.log and c:\cfusion\mail\undelivr for the logs and failed email files) and use that info, but... its obviously limited.
3) it seems to be safer to loop your cfmail for EACH recipient rather than put a bunch in the TO or CC lines as you can get more discrete failure/success info and why and if the mail fails at the sending mail server level, it fails for ALL the recipients instead of just the possibly unique bad email BUT you add to the load of your mail server (and cfserver)...
4) although it is easy to automatically verify the cfmail tag ran successfully, other than checking the logs\mailsent.log or the undlvr folders (if you have access) it doesnt appear there is a way to verify the email actually sent... if you don't have access to the log files (in a hosted situation, for instance), you simply have no idea... :(
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
I am trying to use cfmail for sending emails, where the mail content is in html format and is also having an attachment with the mail. The recipient recieves email with non-html format.
Important, I am using Coldfusion 5.0
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
I am trying to send mail via the cfmail tag. When I send the mail I get an error saying it is an invalid recipient and the server is not a relay host. I know the email address is valid, but I'm not sure about the relay host thing. Any suggestions? Thanks in advance
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
I set up a query to send mail, when I run my cfm I get the error:
TO
The attribute value must evaluate to a string
The error occurred while processing an element with a general identifier of (CFMAIL), occupying document position (29:5) to (29:106).
What am I doing wrong?
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
this tag alone has saved our company tens of thousands so far.
quick question... is there a way to use an alias in the FROM field?
for example WEBMASTER <webmaster@company.com>
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
This page is for ColdFusion 5.
The wraptext parameter was added in ColdFusion MX 6.1.
For the ColdFusion MX 6.1 version of this page please see http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pta.htm.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
A description of the wrap parameter appears to be missing from the docs. Thanks!
Mischa.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Hi:
I need send an attached file with CFMAIL, but I need the follow:
The file has ist real name (i.e. path_to_file\file001.txt or path_to_file\ADBSSH17), but I want to send it with other name, let say CUSTOMERS.xls. Is it possible to do that of someway?
Thanks. Luis Avalos
Antofagasta - Chile
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
* Change between CF 4.5 and CF 5 *
In ColdFusion 4.5, you could place the recipient name as well as their
email address in the To attribute of CFMAIL as follows: to="#email# (#name#)"
The result would be that the recipients name --instead of their email address-- appears in the To when the email arrives.
This functionality is not available in CF 5 Professional (it still works in CF 5 Enterprise).
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
hello
Greetings
it's Really GOOD I wish all the best for ur company
I hope more advance things from your Company
All Prayer Wishes
With love
GINO
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
In attempting to use radio button options in my cfmail form, the server side cf mailer gets errors. Need a HowTo on how to make the server side object work.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
when i send an email whith tag CFMAIL , how can i receive an failure message if may email do not reach the address.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
It seems that you are not able to include images in
the HTML when using CFMAIL. I have been looking
to see if this is a limitation of the tag or if I am missing
something. Can someone verfity this and possible give
me additional option to send an REAL html messages.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
CFMail will not make a copy of an attachment when spooling to disk. It will only put a pointer to the file. If the spooler doesn?t get around to delivering the message, it wont get the attachment.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Threading issues?
Try this: Upload a file from a form. Store it in any directory. In the same page, then create a CFmail, and attachement the uploaded file(works just fine). Then after the cfmail call, delete the attached file in your temp directory. You will find that the cfmail will not have ample time to process, before the deletion process. So I am curious to know whether the cfmail tag is a seperate thread that does not lock. The file is being deleted BEFORE the cfmail tag has a chance to attach it, even though the deletion call occurs later in the page. Funky huh?
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
I've been trying to use <CFMAIL ... > tag to send email messages of a survey to the person in charge of the survey. But so far, here's what has happened.
First, in the ColdFusion Administrator, I specified the mail server and it was verified without an error.
Then, I sent a test message using the <CFMAIL...) tag. But I've never received the test message.
So I opened the ColdFusion Mail Log and here's the error message:
"Error","1480","12/09/02","10:18:38",,"Failed to send the spooled mail file, C:\CFUSION\Mail\spool\747.cfmail. SMTP server replied ""<Jeffrey Feng> Domain name required"" Moved file to C:\CFUSION\Mail\undelivr\749.cfmail."
The erroe message says, ""<Jeffrey Feng> Domain name required"". Where should I specify the domain name?
Please help. Thanks in advance.
Jeffrey
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Using the CFMAIL tag I find that too frequently email is not sent when forms are submitted.
This behavior occurrs despite having specified the server both in the <cfmail> parameters as well as via the ColdFusion MX Admintrator.
I think that part of the issue is that our email servers are clustered, that is there are multiple smtp servers aliased to a single host name.
There is no apparent means to specify either multiple host names or IP addresses. Nor does, CF attempt to deliver email if at first it does not succeed.
In any case, the failure to properly process and deliver email is unacceptable.
Recommendations would be greatly appreciated.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
I pass the path of the attachment to the cfmail tag from an html file type text tag, but the error says the file doesn't exist. The path is correct. What might be wrong?
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Update from Macromedia, in response to kencl@shaw.ca:
In the CFMAIL tag, you can delimit multiple e-mail addresses in the To, CC and BCC fields with commas or semicolons.
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Macromedia update:<p>
Responding to sbouli's comment, the cfmail tag has been updated in ColdFusion MX.
Please see the ColdFusion MX reference entry for the cfmail tag, at:<p>
http://livedocs.macromedia.com/cfmxdocs/CFML_Reference/Tags-pt2.jsp#2355015
<p>
There is more information at:<p>
http://livedocs.macromedia.com/cfmxdocs/Developing_ColdFusion_MX_Applications_with_CFML/email.jsp
Christina Lamkin
Sr. technical writer
ColdFusion team
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Does MX handle this tag in a better way ? I speak about the delay to handle big amout of email ! it appear to make package that we cannot configure !!
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
The method to send e-mail to multiple recipients is not clearly explained. For example, can we simply separate multple e-mail addresses in the to: cc: and bcc: fields with "; ", or do we need to contain <cfmail>...</cfmail> within a <cfloop>?
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
I am having troubles with special German characters. As far as I can see, CF does no encoding and sends them as plain text. Outlook and Outlook Express have no troubles reading cfmail-generated eMails, but Groupwise has difficulties...
Any ideas=
LiveDocs Comments - coldfusion - 5.0 - CFML_Reference - Tags65.htm
Server is NOT required, but the docs say so:
"Required. The address of the SMTP server to use for sending messages. If no server is specified, the server name specified in the ColdFusion Administrator is used."
[Top]
Recommended Books
COLDFUSION MX Web Application Construction Kit (5th Edition)
Authors: Ben Forta and Nate Weiss
1500 pages
[Top]
Web Sites
Macromedia
The makers of ColdFusion/ColdFusion MX.
ColdFusion Developer's Journal
Forta.com (ColdFusion Section)
Ben Forta is Macromedia's Senior Technical Evangelist. Here on his site find useful ColdFusion information.
Flash CFM
Flash and ColdFusion Development.
Handling file uploads without CFFILE
BLOG post by "Sam" on REWINDLIFE.COM gives insight into how to upload a file on your site if you are not allowed to use the CFFILE tag.
[Top]
Copyright © 2003- 2010, Orville Paul Chomer, All Rights Reserved
Home Page
Blog
How To
Chomer TV
The Show
Webcam Videos
Freeware
•
VB Mahjongg
Coding
•
ColdFusion
•
Javascript
•
Visual Basic
Other Places
Acoustic Eidolon
History Singers
Scobleizer
Beach Walks
Freshtopia
CSS Zen Garden