That's easy: make sure you configure your SMTP correctly in the ColdFusion Administrator (in the Mail tab).
Specify the SMTP-server (mail.mycompany.com for example), server port usually is 25.
The code to send mail is:
I've configured my smtp server correctly but still got the same old error msg:
Error Diagnostic Information
Attribute set validation error in tag CFMAIL
The tag has an invalid attribute combination: the most likely attribute combination is
Required attributes: 'FROM,GROUP,QUERY,SUBJECT,TO'. Optional attributes: 'BCC,CC,GROUPCASESENSITIVE,MAILERID,MAXROWS,MIMEATTACH,PORT,SERVER,STARTROW,TIMEOUT,TYPE'.
Other possible combinations are
Required attributes: 'FROM,QUERY,SUBJECT,TO'. Optional attributes: 'BCC,CC,MAILERID,MAXROWS,MIMEATTACH,PORT,SERVER,STARTROW,TIMEOUT,TYPE'.
Required attributes: 'FROM,GROUP,SUBJECT,TO'. Optional attributes: 'BCC,CC,GROUPCASESENSITIVE,MAILERID,MAXROWS,MIMEATTACH,PORT,SERVER,TIMEOUT,TYPE'.
Required attributes: 'FROM,SUBJECT,TO'. Optional attributes: 'BCC,CC,MAILERID,MIMEATTACH,PORT,SERVER,TIMEOUT,TYPE'.
The error occurred while processing an element with a general identifier of (CFMAIL), occupying document position (15:5) to (21:33).
The specific sequence of files included or processed is:
D:\WebTrax\test.cfm
<!--- This view-only example shows the use of CFMAIL --->
<HTML>
<HEAD>
<TITLE>CFMAIL Example</TITLE>
</HEAD>
<BODY bgcolor=silver>
<H3>CFMAIL Example</H3>
<P>This view-only example shows the use of CFMAIL. If your CFAS mail
settings are configured successfully and the comments are removed,
you will be able to use this code to send simple email.
<CFIF IsDefined("form.mailto">
<CFIF form.mailto is not "" AND form.mailfrom is not "" AND
form.Subject is not "">
<cfmail to="#form.mailto#"
from="#form.mailFrom#"
subject="#form.subject#"
server="smtp.tm.net.my"
port="25"
timeout="100"
groupcasesensitive="Yes">This message was sent by an
automatic mailer built with CFMAIL:
====================================================
#form.body#</cfmail>
<H3>Thank you</H3>
<P>Thank you, <CFOUTPUT>#mailfrom#: your message, #subject#, has
been sent to #mailto#</CFOUTPUT>.
</CFIF>
</CFIF>
<P>
<FORM ACTION="test.cfm" METHOD="POST">
<PRE>
TO: <INPUT TYPE="Text" NAME="MailTo">
FROM: <INPUT TYPE="Text" NAME="MailFrom">
SUBJECT: <INPUT TYPE="Text" NAME="Subject">
<hr>
MESSAGE BODY:
<TEXTAREA NAME="Body" COLS="40" ROWS="5" WRAP="VIRTUAL"></TEXTAREA>
</PRE>
<!--- establish required fields --->
<INPUT TYPE="Hidden" NAME="MailTo_required" VALUE="You must enter a
recipient for this message">
<INPUT TYPE="Hidden" NAME="MailFrom_required" VALUE="You must enter a
sender for this message">
<INPUT TYPE="Hidden" NAME="Subject_required" VALUE="You must enter a
subject for this message">
<INPUT TYPE="Hidden" NAME="Body_required" VALUE="You must enter some text
for this message">
<P><INPUT TYPE="Submit" NAME="">
</FORM>
Just remove "groupcasesensitive="Yes"" as this only applies to using <cfmail> with a database query. If you remove that attribute, I believe it will work as I don't see any other problems.
Yes! the errors are gone. Got message sent BUT the mail never arrived. I've set the mail to go into my real mail acc for testing but i never received my test mail. I would really appreciate if u could explain.
You'll want to check the mail log to see if there were any errors. If there are no errors pertaining to your message and the message did not show up in the undeliverable folder (cfusion\mail\undeliverable), then it most likely was sent and received by the mail server. It's possible that the mail server rejected the message due to relaying restrictions. If it did show up in the error log, post the error and I or someone can probably tell you what to look for.
"Error","TID=-439155","01/26/01","04:17:49","Failed to send the spooled mail file, C:\CFUSION\MAIL\spool\381.cfmail. SMTP server replied "Unable to connect to mail server."
Anyway, i would like to thank you guys for your quick response. I really appreciate it...i now understand my situation at least...
Just want last question
Is there any public smtp server for me to use, like a legal free one?
THESE ARE MY MAIL LOG
Moved file to C:\CFUSION\MAIL\undelivr\1315.cfmail."
"Error","TID=-343893","01/27/01","00:51:36","Failed to send the spooled mail file, C:\CFUSION\MAIL\spool\20B4.cfmail. SMTP server replied "Unable to connect to mail server." Moved file to C:\CFUSION\MAIL\undelivr\3244.cfmail."
"Error","TID=-343893","01/27/01","01:02:31","Failed to send the spooled mail file, C:\CFUSION\MAIL\spool\1240.cfmail. SMTP server replied "Unable to connect to mail server." Moved file to C:\CFUSION\MAIL\undelivr\21F4.cfmail."
"Error","TID=-343893","01/27/01","01:03:16","Failed to send the spooled mail file, C:\CFUSION\MAIL\spool\12B4.cfmail. SMTP server replied "Unable to connect to mail server." Moved file to C:\CFUSION\MAIL\undelivr\3104.cfmail."
All real ISPs will provide a mail server for you to use so you should have one through whoever connects you to the internet. If their address is "
try "acme.com", "smtp.acme.com", or "mail.acme.com" as these are the common naming conventions. Once you are able to verify the smtp server under the mail settings in the cf admin, you shouldn't have any problems. Based on your last post, I'm guessing the verify option gives an error.
I would set the smtp server in the cf admin and then remove it from your code unless you have a reason not to. If you ever need to change mail servers, it's much easier to do in one place in the cf admin.
If you need, I can give you an account on our mail server to use until you locate a permanent mail server to use.
I've tried my ISP's smtp but IS NOT WORKING ONLY WITH COLDFUSION CFMAIL. If I use other mail clients such as Eudora or Outlook, I'm able to use my smtp without any problem. Seems like something wrong with my CF server setting or somethin BUT I'm postively sure that my setting are ok. Can this mail problem have any relation with my loopback cause currently i'm running everything with my 127.0.0.1 address. Do I need to have a NIC + IP address in order to compose and sen email?
About your offer, yes i need your smtp add at least to test my code. If u don't want to publish the add, u can mail me at azri@posmalaysia.com
my mail can get thru now but i have another problem, i send only once, but i received hundreds of copies. WHY is this happenning to me pls help
these are my mail log
"Warning","TID=-479103","01/28/01","00:41:06","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
"Warning","TID=-371347","01/28/01","00:41:07","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
"Warning","TID=-479103","01/28/01","00:41:08","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
"Warning","TID=-371347","01/28/01","00:41:08","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
"Warning","TID=-479103","01/28/01","00:41:10","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
"Warning","TID=-371347","01/28/01","00:41:10","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
"Warning","TID=-479103","01/28/01","00:41:12","Unable to move the spooled mail file, C:\CFUSION\MAIL\spool\8370.cfmail. Access is denied.."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.