Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function send_message($from, $recipient, $subject, $email_content)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
- curl_setopt($ch, CURLOPT_USERPWD, 'api:key-f2524e3723fd79b88580971f1bcf9a46');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
- curl_setopt($ch, CURLOPT_URL,
- 'https://api.mailgun.net/v3/mg.mobilerocket.co.uk/messages');
- curl_setopt($ch, CURLOPT_POSTFIELDS,
- array('from' => $from,
- 'to' => $recipient,
- 'subject' => $subject,
- 'text' => $email_content
- ));
- $result = curl_exec($ch);
- curl_close($ch);
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement