How do we add an attachment with mailgun ? Why can't I find how to do such a basic thing ? I've tried multiple recipes, and it never works.
For instance :
$msg = $mg->MessageBuilder();
$msg->setFromAddress($sender_email);
$msg->addToRecipient($to);
$msg->setSubject($subject);
$msg->setTextBody($body);
$msg->addAttachment('zzz.txt');
$files['attachment'] = array();
$files['attachment'][] = 'zzz.txt';
$mg->post("{$domain}/messages", $msg->getMessage(), $files);
Why the file zzz.txt is not included in the email ?
Why is there absolutely no clear instructions anywhere about how to do this ?