如何使用mailgun发送html电子邮件?

时间:2018-06-28 10:47:01

标签: mailgun

我想使用curl使用mailgun测试html电子邮件。以下是他们的文档:

 curl -s --user 'api:(my api key)' \
 https://api.mailgun.net/v3/my domain/messages \
 -F from='User <me@mydomainname>' \
 -F to='me@example.com' \
 -F cc='me@example.com' \
 -F bcc='me@example.com' \
 -F subject='Hello' \
 -F text='Testing' \
 --form-string html='<html xmlns="http://www.w3.org/1999/xhtml"><head>..... MY INLINE HTML HERE.....</html>'

它不使用-form-string html 发送消息。应该有其他方法吗?谢谢!

1 个答案:

答案 0 :(得分:1)

使用 curl -sv 代替 curl -s

curl -sv --user 'api:YOUR API HERE' \
https://api.mailgun.net/v3/YOUR DOMAIN HERE.mailgun.org/messages \
-F from='Excited User <mailgun@YOUR DOMAIN HERE.mailgun.org>' \
-F to=you@example.com \
-F to=you@example.com \
-F subject='Hello' \
-F text='Testing' \
--form-string html='HTML HERE'
相关问题