问题
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
来源:https://stackoverflow.com/questions/19823780/integrating-sendgrid-s-smtp-api-with-cfmail