The following URLFetch must be almost right. the error message is
{ "message": "'from' parameter is missing"}
This is the command used:
URLFetch["https://api.mailgun.net/v3/sandboxYOURID.mailgun.org/\
"Parameters" ->
{
"from" -> "Mailgun Sandbox<postmaster@sandboxYOURID.mailgun.org>",
mailname<emailaddress>",
"subject" -> "Hello",
"text" -> "Congratulations message has been send",
"html" ->
"<html> <center> HTML version of the body <img src='cid:pdfpicture.jpg'></center></html>"
},
"MultipartData" -> {{"inline", "multipart/form-data" , Import["pdfpicture.jpg", "Byte"]} },
(*"JSON", *)
"Method" -> "POST",
"Username" -> "api",
"Password" -> "key-YOURKEY"
]
If I use getpostman.com to check my API command it works fine. There must be a syntax error in my URLFetch lines.
note: in mma9 "MultipartData" was used in mma10.1 use "MultipartElements"