Mailgun is good service provider which is allows you to send bulk emails via Mailgun API. Mailgun assembled a MIME message. In short, SMTP is an open and established protocol with large ecosystem, while Mailgun API is better long term performance and maintenance wise. Mailgun service is an Email automation service. Inbuilt functions for sending, tracking or receiving emails.
$ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, 'YOUR-API-KEY'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_URL, 'https://api.mailgun.net/v2/samples.mailgun.org/messages'); curl_setopt($ch, CURLOPT_POSTFIELDS, array('from' => 'Significant Techno <email@example.com>', 'to' => 'User Name <firstname.lastname@example.org>', 'subject' => 'Hello', 'text' => 'Testing some Mailgun awesomeness!')); $result = curl_exec($ch); curl_close($ch); return $result;
Your email address will not be published. Required field are marked*