Home › Forums › WordPress Plugins › Mailgun Bulk Mailer Error
- This topic has 5 replies, 2 voices, and was last updated 2 years, 1 month ago by
MM.
-
AuthorPosts
-
-
March 8, 2023 at 8:22 am #29820
vinny
KeymasterHi MM,
Thanks for reaching out. The logs show that messages were sent successfully on 22/02/2023 04:23:48, but then started failing due to an error from Mailgun. I’ll look into the code as to why the error message is not showing, but this indicates that you should contact Mailgun support to see why they’re blocking the send.
Cheers,
Vinny -
March 22, 2023 at 8:10 am #29868
MM
ParticipantThis did not fix yet.
From Mailgun support
Your account is currently active so if you need help with sending with the API, here is some information that should help you in sending: https://documentation.mailgun.com/en/latest/user_manual.html#sending-via-api Sending a plain text message: 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 [email protected] \ -F subject='Hello' \ -F text='Testing some Mailgun awesomeness!'
Please advise.
-
March 22, 2023 at 8:10 am #29869
MM
ParticipantTo confirm. I have tested the API as they have suggested and it works well.
[code]
add_shortcode( ‘test_mailgun_api’, function(){
$apiKey = ‘f51eXXXXXXXXXXXXXXXXXXXX-d1a07e51-b785537c’;
$domain = ‘mg.domain.org’;
$from = ‘Excited User <[email protected]>’;
$to = ‘[email protected]’;
$to2 = ‘[email protected]’;
$subject = ‘Hello’;
$text = ‘Testing some Mailgun awesomeness!’;$url = “https://api.mailgun.net/v3/$domain/messages”;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, ‘api:’ . $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
‘from’ => $from,
‘to’ => $to,
‘to’ => $to2,
‘subject’ => $subject,
‘text’ => $text,
]);$result = curl_exec($ch);
ob_start();
if (curl_errno($ch)) {
echo ‘Error:’ . curl_error($ch);
} else {
echo ‘Mail sent successfully’;
}curl_close($ch);
return ob_get_clean();
});
[/code] -
March 22, 2023 at 8:13 am #29872
vinny
KeymasterHi MM,
That response from support is not helpful. Please check the Mailgun logs the next time it fails for relevant information about the failures.
-
March 22, 2023 at 3:07 pm #29876
MM
ParticipantThat’s the problem. I don’t see any error details on the log. It just shows “Mailgun returned an error: ” plus there’s nothing shown in log at Mailgun dashboard.
-
-
AuthorPosts
- You must be logged in to reply to this topic.