Whatever message this page gives is out now! Go check it out!
<cfmail
from="#Form.EMailAddress#"
to="marketing@MyCompany.com,sales@MyCompany.com"
subject="Customer Inquiry">
A customer inquiry was posted to our website:
Name: #Form.FirstName# #Form.LastName#
Subject: #Form.Subject#
#Form.InquiryText#
</cfmail><cfmail
query="ProductRequests"
from="webmaster@MyCompany.com"
to="marketing@MyCompany.com"
subject="Widget status report">
Here is a list of people who have inquired about
MyCompany Widgets during the previous seven days:
<cfoutput>
#ProductRequests.FirstName# #ProductRequests.LastName# (#ProductRequests.Company#) - #ProductRequests.EMailAddress#&##013;
</cfoutput>
Regards,
The webmaster
webmaster@MyCompany.com
</cfmail>Code | Description |
<cfoutput>
#ProductRequests.FirstName# #ProductRequests.LastName# (#ProductRequests.Company#) - #ProductRequests.EMailAddress#&##013;
</cfoutput>Presents a dynamic list embedded within a normal message, repeating for each row in the ProductRequests query. Because the cfmail tag specifies a query, the cfoutput tag does not use a query attribute. The &##013; forces a carriage return between output records. |
<cfquery name="BetaTesters" datasource="myDSN">
SELECT * FROM BETAS
</cfquery>
<cfmail query="BetaTesters"
from="beta@MyCompany.com"
to="#BetaTesters.TesterEMail#"
subject="Widget Beta Four Available">
To all Widget beta testers:
Widget Beta Four is now available
for downloading from the MyCompany site.
The URL for the download is:
http://beta.mycompany.com
Regards,
Widget Technical Support
beta@MyCompany.com
</cfmail><cfquery name="GetCustomers" datasource="myDSN">
SELECT * FROM Customers
</cfquery>
<cfmail query="GetCustomers"
from="service@MyCompany.com"
to="#GetCustomers.EMail#"
subject="Contact Info Verification">
Dear #GetCustomers.FirstName# -
We'd like to verify that our customer
database has the most up-to-date contact
information for your firm. Our current
information is as follows:
Company Name: #GetCustomers.Company#
Contact: #GetCustomers.FirstName# #GetCustomers.LastName#
Address:
#GetCustomers.Address1#
#GetCustomers.Address2#
#GetCustomers.City#, #GetCustomers.State# #GetCustomers.Zip#
Phone: #GetCustomers.Phone#
Fax: #GetCustomers.Fax#
Home Page: #GetCustomers.HomePageURL#
Please let us know if any of this
information has changed, or if we must
get in touch with someone else in your
organization regarding this request.
Thanks,
Customer Service
service@MyCompany.com
</cfmail>Code | Description |
<cfquery name="GetCustomers" datasource="myDSN">
SELECT * FROM Customers
</cfquery>Retrieves all data from the Customers table into a query named GetCustomers. | ||
<cfmail query="GetCustomers"
from="service@MyCompany.com"
to="#GetCustomers.EMail#"
subject="Contact Info Verification">Uses the to attribute of cfmail, the #GetCustomers.Email# query column causes ColdFusion to send one message to the address listed in each row of the query. Therefore, the mail body does not use a cfoutput tag. | ||
Dear #GetCustomers.FirstName# -
......
Company Name: #GetCustomers.Company#
Contact: #GetCustomers.FirstName# #GetCustomers.LastName#
Address:
#GetCustomers.Address1#
#GetCustomers.Address2#
#GetCustomers.City#, #GetCustomers.State# #GetCustomers.Zip#
Phone: #GetCustomers.Phone#
Fax: #GetCustomers.Fax#
Home Page: #GetCustomers.HomePageURL#Uses other query columns (#GetCustomers.FirstName#, #GetCustomers.LastName#, and so on) within the cfmail section to customize the contents of the message for each recipient. |
<cfmail from="Sender@Company.com" server="sendmail.myCo.com" sign="true" keystore="C:\OpenSSL\bin\hello.jks" keystorepassword="digital" to="Recepient@Company.com" keyalias="crypto" keypassword="signature" subject="Mail with Digital Signature"> |