4

I am making this request with the Mailgun API:

var filepath = path.join(__dirname, "/output/" + job.jobId + ".zip");

var data = {
    from: 'Name <name@url.com>',
    to: email,
    subject: 'Test',
    text: 'Test',
    attachment: filepath
};

mailgun_client.messages().send(data, function(error, body) {
    if(error) console.log(error)
    console.log(body);
});

and am getting this error:

{ [Error: <html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.7.9</center>
</body>
</html>
] statusCode: 413 }

How do I fix this? Is it because the attachment is too big?

This is running on a Digital Ocean server, and I never set up nginx. This is simply an express.js app.

carte
  • 983
  • 2
  • 9
  • 27
  • 3
    Most probably. "Note Mailgun supports maximum messages size of 25MB." - https://documentation.mailgun.com/user_manual.html#sending-via-api – Sev Jun 20 '15 at 15:47
  • That was it. The attachment was > 25MB. – carte Jun 22 '15 at 17:25

0 Answers0