使用mailgun发送电子邮件时尝试使用模板。最终以没有HTML内容的退回状态

当我使用API​​发送电子邮件并告诉API这是模板时,另一端出现的只是模板的名称。

我正在使用官方的Mailgun SDK: https://github.com/mailgun/mailgun-php

这是我的代码:

$mailgunDomain = 'mailgun.example.com';

$emailaddress = 'foo@example.com';

$fullName = 'John Doe';

$url = 'https://www.example.com';

$response = $mg->messages()->send($mailgunDomain,[
    'from'    => 'example <test@example.com>','to'      => $emailaddress,'subject' => 'Hello','template' => 'welcomemessage-2019-11-20.233057','text'    => 'Testing some Mailgun awesomness!','h:X-Mailgun-Variables' => "{'URL': $url,'user': $fullName}"
]);

结果是-当我查看mailgun的登录信息时-welcomemessage-2019-11-20.233057 另外:电子邮件永远不会到达,最终以退回状态结束。

使用CURL时会发生预期的结果。然后,我收到HTML格式的电子邮件。

所以我想知道: 我的直觉说我做错了事。但是我不知道那是什么。期待收到任何指示。

xiaoruyuango 回答:使用mailgun发送电子邮件时尝试使用模板。最终以没有HTML内容的退回状态

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3054590.html

大家都在问