I am using SendGrid’s SMTP API (not WEB API) and am considering sending an email using cfmail
. If I use cfmail
to send the email, and want to use the X-SMTPAPI
header somewhere, do you think that cfmail
is a place to do that? Please clarify.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You would do this by adding a custom header, using the cfmailparam
tag. As such:
<cfmailparam
name="X-SMTPAPI"
value="{\"category\":\"Cool Emails\"}">
In context of the cfmail
tag it would be as follows.
<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