There is a curl code
curl -s --user 'api:YOUR_API_KEY' \ https://api.mailgun.net/v3/YOUR_DOMAIN_NAME/messages \ -F from='Excited User <mailgun@YOUR_DOMAIN_NAME>' \ -F to=YOU@YOUR_DOMAIN_NAME \ -F to=bar@example.com \ -F subject='Hello' \ -F text='Testing some Mailgun awesomness!' This code is proposed for sending mailgun. But I can not understand how to apply this in reality php, where there is curl_init (), curl_setopt (), curl_exec () and curl_close ().