在 mailgun 文档中找不到我的问题的解决方案后,我将解释我在寻找什么。
今天我正在使用 phpList 发送我的时事通讯(它工作得很好!),我有 HTML 页面,我只是包含在 phpList 应用程序中来发送它。(我正在使用 SMTP 方法发送消息)。我想知道我是否可以对 mailgun 做同样的事情(当然可以,但是怎么做?),是否可以只包含我的 HTML 页面的路径以将其发送出去?(我没有兴趣在脚本中键入我的 html 代码,它必须在路径中,否则我对使用 mailgun 没有兴趣)。
看看我的mailgun php代码如下:
$result = $mgClient->sendMessage("$domain",
array('from' => 'My Business Name <me@samples.mailgun.org>',
'to' => 'name-1@gmail.com, name-3@gmail.com, name-3@gmail.com',
'subject' => 'Issue Feb 2014',
'text' => 'Your mail do not support HTML',
'html' => '<html>Inline image: <img src="cid:Pad-Thai-1.jpg"></html>',
'recipient-variables' => '{"name-1@gmail.com": {"first":"Name-1", "id":1}, "name-2@gmail.com": {"first":"Name-2", "id": 2}}'),
array('inline' => 'Pad-Thai-1.jpg'));
我有一个名为 的数组元素'html'
,我想包含我的 HTML 页面的路径(如果不可能,我可以把它放在哪里?)。我只是不能在这个 html 数组元素中包含我的整个 HTML 代码,因为它是如此广泛。
但是mailgun声称简单而伟大,这就是我想要改变的动机。