我对发送HTML电子邮件进行了一个小测试(三个消息)。所有三个都拒绝了以下内容:
{\n "message": "Invalid request content type. Expecting \'multipart/form-data\' but got \'application/x-www-form-urlencoded\' instead."\n}
我是新来的人,所以我确定我做错了什么,但是我不知道要解决什么。似乎与我的内容标记有关。这是我用于测试消息的HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Efani SIM Protect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<table align="left" border="1" cellpadding="0" cellspacing="0" width="600" style="border-collapse: collapse;">
<tr>
<td style="font-size: 0; line-height: 0;" height="10">
This is a test of the email blaster's capabilities.
</td>
</tr>
<tr>
<td>
<a href="https://efani.com/?ref=11&campaign=JohnCrockett">Hello world! I am an anchor tag!</a>
</td>
</tr>
</table>
</html>
如果有人能指出正确的方向,我将不胜感激。
在标题中,请确保指定多部分/表单数据编码。每个mailgun的api文档:“您必须使用multipart / form-data编码”。试试看,让我们知道它是否有效! :)祝你好运!