• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Q&A

Q1:I host my ColdFusion site with a remote Web provider. What SMTP server should I specify in my <CFMAIL>tags?
A1: If your Web provider has done its homework, it will have already defined a mailserver in ColdFusion Administrator. If so, you don't need to supply a name in <CFMAIL>—but do be sure that your FROM address is one that will be accepted by that server.
Q2:When I access a template that uses <CFMAIL>, I get an error relating to the mail server. What's the problem?
A2: First, make sure that the machine on which ColdFusion runs has rights to send mail on the SMTP server specified. If you haven't defined a server, check the default setup in ColdFusion administrator (or have your provider check it) to be sure that one is defined.
Q3:Rather than type the contents of my messages into a database, can I keep text files on my server and then have <CFMAIL>retrieve them by filename?
A3: Yes. Use a tag called <CFINCLUDE>, which performs a server-side include of the file you specify. For example, this line between your opening and closing <CFMAIL> tags:
<CFINCLUDE TEMPLATE="mytext.txt">

would plug the contents of mytext.txt into your message body. You can also supply the name of the included template dynamically with a variable.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint