CFMAIL example
From a table named "maillist" that looks as follows:
Key | last_name | first_name | email_address |
---|---|---|---|
1 | Peet | Jim | jrpeet@somedomain.com |
2 | Smith | Fred | fred.smith@somedomain.com |
3 | Edwards | Karen | kedwards@somedomain.com |
... | ....... | .... | ....@somedomain.com |
n | ...... | .... | ....@somedomain.com |
---------- The Cold Fusion is as follows ------------- (note HTML tags excluded)
<!-- Query -->
<cfquery name="get_maillist" datasource="some_data_source">
select * from maillist
</cfquery>
<!--- Emails are sent right now! -->
<h1>cfmail test</h1>
<cfoutput query="get_maillist">
<CFMAIL
TO="#email_address#"
from="jrpeet@anydomain.com"
subject="Your Reservation has been Recorded"
type="HTML">
<html>
<head>
<style>
H1 {font: bold 18pt "Verdana","Comic Sans","Arial"; color: navy}
p { font: 10pt "Verdana","Comic Sans","Arial"; color: navy}
</style>
</head>
<body bgcolor="aliceblue">
<div align="center">
<h1>Reservation Accepted</h1>
</div>
</body>
</html>
</CFMAIL>
</cfoutput>
No comments:
Post a Comment
Any anonymous comments with links will be rejected. Please do not comment off-topic