将SendGrid的SMTP API与CFMAIL集成

时间:2013-11-06 22:04:35

标签: coldfusion coldfusion-9 sendgrid cfmail

我正在使用SendGrid’s SMTP API(不是WEB API),我正在考虑使用cfmail发送电子邮件。如果我使用cfmail发送电子邮件,并希望在某处使用X-SMTPAPI标题,您认为cfmail是否可以这样做?请澄清。

1 个答案:

答案 0 :(得分:2)

您可以使用cfmailparam标记添加自定义标头。就这样:

<cfmailparam  
    name="X-SMTPAPI" 
    value="{\"category\":\"Cool Emails\"}">

cfmail标签的上下文中,它将如下所示。

<cfmail 
    from="you@example.com" 
    to="nick@sendgrid.com" 
    subject="I am using CF Mail to do this!"> 
<cfmailparam  
    name="X-SMTPAPI" 
    value="{\"category\":\"Cool Emails\"}">

Look at my awesome use of cfmail!
</cfmail>

More can be found in the Adobe Documentation

相关问题