after failed to find a solution for my problem in the mailgun documentation, I will explain what I\'m looking for.
Today I\'m using phpList to send out my newsletter (It
Adding a link to Mailgun documentation. This helped me while constructing HTML and MIME messages. https://documentation.mailgun.com/api-sending.html#examples
As per documentation:
# Include the Autoloader (see "Libraries" for install instructions)
require 'vendor/autoload.php';
use Mailgun\Mailgun;
# Instantiate the client.
$mgClient = new Mailgun('YOUR_API_KEY');
$domain = "YOUR_DOMAIN_NAME";
# Make the call to the client.
$result = $mgClient->sendMessage($domain, array(
'from' => 'Excited User ',
'to' => 'foo@example.com',
'cc' => 'baz@example.com',
'bcc' => 'bar@example.com',
'subject' => 'Hello',
'text' => 'Testing some Mailgun awesomness!',
'html' => 'HTML version of the body'
), array(
'attachment' => array('/path/to/file.txt', '/path/to/file.txt')
));