【问题标题】:Sending HTML by cURL on MAILGUN在 MAILGUN 上通过 cURL 发送 HTML
【发布时间】:2015-01-24 06:45:27
【问题描述】:

我尝试通过电子邮件发送。我尝试了很多方法,但总是得到同样的结果:一个错误。

http://goto-21.net/campaign/htmlversion?mkt_hm=0&AdministratorID=47507&CampaignID=58&StatisticID=62&MemberID=733807&s=994508d6292a660150ccc60c3f0310d4&isDemo=0

我试过这个:

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \ Xhttps://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='兴奋的用户'\ -F to='foo@example.com' \ -F cc='bar@example.com' \ -F 密件抄送='baz@example.com' \ -F 主题='你好'\ -F text='测试一些 Mailgun 的威力!' \ -F html='这里的代码'\

还有这个:

curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \ Xhttps://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='兴奋的用户'\ -F to='foo@example.com' \ -F cc='bar@example.com' \ -F 密件抄送='baz@example.com' \ -F 主题='你好'\ -F text='测试一些 Mailgun 的威力!' \ --form-string html='这里的代码'\

但它不起作用...总是''语法错误''

谁能帮帮我?

谢谢!

【问题讨论】:

标签: html curl mailgun


【解决方案1】:

使用以下 cURL 命令通过命令行发送 HTML 电子邮件。 用你自己的替换大写参数,你就可以发送了!

curl -s --user 'api:YOUR-API-KEY' https://api.mailgun.net/v2/YOURDOMAIN/messages -F from='YOU@YOURPROVIDER.COM' -F to=RECEIVER@PROVIDER.com -F subject='Hello World with HTML' -F html='<html><head><title>Hello</title></head><body>Hello <strong>World</strong></body></html>' -F text='Hello world'

它的作用是从附加到您的域的地址向接收者发送一封电子邮件,发送 html 和纯文本版本作为后备!

祝你邮寄愉快

最好的,

【讨论】:

    【解决方案2】:

    原始请求如下所示:

    curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \
        https://api.mailgun.net/v3/samples.mailgun.org/messages \
        -F from='Excited User <excited@samples.mailgun.org>' \
        -F to='devs@mailgun.net' \
        -F subject='Hello' \
        -F text='Testing some Mailgun awesomeness!'
    

    但你在 https 之前有一个大 X。

    curl -s --user 'api:key-3ax6xnjp29jd6fds4gc373sgvjxteol0' \ 
    -------> X <----- https://api.mailgun.net/v2/samples.mailgun.org/messages \ -F from='Excited User ' \ -F to='foo@example.com' \ -F cc='bar@example.com' \ -F bcc='baz@example.com' \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!' \ --form-string html=' CODE HERE ' \
    

    这可能会导致错误

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-15
      • 2016-10-26
      • 1970-01-01
      • 2016-11-01
      • 1970-01-01
      • 2021-05-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多