万卷书>>电脑书籍>>网页制作>>网页制作软件使用>>ColdFusion 初级教程

WANJUANSHU.COM

为多个收信者定制Email

在下面的例子中,查询“GetCustomers”用于获取一批用户的联系信息。然后查询结果被用来向每个用户发送一个email,要求他们证实其联系信息是否仍然有效:


 

<CFMAIL QUERY="GetCustomers"


 

FROM="service@allaire.com"


 

TO="#EMail#"


 

SUBJECT="Contact Info Verification">


 

Dear #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: #Company#


 

Contact: #FirstName# #LastName#


 

Address:


 

#Address1#


 

#Address2#


 

#City#, #State# #Zip#


 

Phone: #Phone#


 

Fax: #Fax#


 

Home Page: #HomePageURL#


 

Please let us know if any of the above


 

information has changed, or if we need to


 

get in touch with someone else in your


 

organization regarding this request.


 

Thanks,


 

Allaire Customer Service


 

service@allaire.com


 

</CFMAIL>


 

注意在CFMAIL的TO属性中用到了查询字段#Email#,将邮件发送到查询所得的email地址。在CFMAIL的信息体中用到了其它查询变量(FirstName,LastName等),为不同的收信者定制不同的邮件内容。


 

附带一个MIME文件


 

在下的例子中,一个MIME文件与email信息一起被发送:


 

<CFMAIL FROM="info@allaire.com"


 

TO="jdoe@supercomputer.com"


 

SUBJECT="File you requested"


 

MIMEATTACH="c:\cfmanual.doc">


 

Dear Joe,


 

Here is a copy of the file you requested.


 

Regards,


 

The Allaire Team


 

</CFMAIL>

 
上一页 WanJuanShu.COM 下一页
WANJUANSHU.COM 万卷书