• Resolved MikeKremer

    (@thesmeghead)


    I have setup my sendgrid account and got an email that it is provisioned a day ago, installed the plugin on my wordpress site, got an API key from the sendgrid site, configured the plugin, and have tried multiple times to send a test email, but each time the response is “Email wasn’t sent.”

    Any clue about the issue would be most appreciated!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Anonymous User 12640152

    (@anonymized-12640152)

    Hi @thesmeghead,

    Please install Query Monitor plugin and try the exact same scenario again and see where the error come from. After that, we might help you if it is SendGrid related.

    Thank you,
    SendGrid

    Thread Starter MikeKremer

    (@thesmeghead)

    Thanks for the offer to help! I installed Query Monitor, and tried sending the test email. Here is the Query Monitor output that was highlighted in red (let me know if there are other parts of the report that you need):

    3	POST
    https://api.sendgrid.com/api/mail.send.json	400 Bad Request	WP_Http->post()
     wp-includes/class-http.php:576
    wp_remote_post()
     wp-includes/http.php:187
    Sendgrid_API->send()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/sendgrid/class-sendgrid-api.php:50
    wp_mail()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/sendgrid/sendgrid-wp-mail.php:407
    Sendgrid_Settings::send_test_email()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php:768
    Sendgrid_Settings::do_post()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php:384
    Sendgrid_Settings::show_settings_page()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php:142
    do_action('settings_page_sendgrid-settings')
     wp-includes/plugin.php:524	Plugin: sendgrid-email-delivery-simplified	5	0.1331
    Anonymous User 12640152

    (@anonymized-12640152)

    Hi @thesmeghead,

    This is weird. Can you please attach a screenshot of your settings? We want to reproduce your issue.

    Thanks,
    SendGrid

    I’m having the same issue.

    1	POST
    https://api.sendgrid.com/api/mail.send.json	400 Bad Request	WP_Http->post()
     wp-includes/class-http.php:576
    wp_remote_post()
     wp-includes/http.php:187
    Sendgrid_API->send()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/sendgrid/class-sendgrid-api.php:50
    wp_mail()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/sendgrid/sendgrid-wp-mail.php:407
    Sendgrid_Settings::send_test_email()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php:768
    Sendgrid_Settings::do_post()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php:384
    Sendgrid_Settings::show_settings_page()
     wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php:142
    do_action('settings_page_sendgrid-settings')
     wp-includes/plugin.php:524	Plugin: sendgrid-email-delivery-simplified	5	0.0792

    Settings – 1
    Settings – 2

    Thread Starter MikeKremer

    (@thesmeghead)

    My settings are pretty much the same as crumptoninc

    SendGrid plugin settings

    • This reply was modified 7 years, 11 months ago by MikeKremer.
    Anonymous User 12640152

    (@anonymized-12640152)

    Hi guys,

    What version of WordPress are you using and what version of SendGrid plugin?

    Thanks,
    SendGrid

    Thread Starter MikeKremer

    (@thesmeghead)

    WordPress 4.6.1

    SendGrid plugin Version 1.10.2

    Anonymous User 12640152

    (@anonymized-12640152)

    Hi,

    Still can’t reproduce this issue. It maybe something caused by your hosting and the way it communicates with external APIs.

    Thank you,
    SendGrid

    My versions are the same. WordPress 4.6.1 and SendGrid 1.10.2.

    FYI — I was having this same problem, WP 4.7 and SendGrid 1.10.2. After hours of playing with recreating new API keys, I finally tried Authentication method: Username&password in the SendGrid plugin settings and my test message was finally delivered. Upon a successful message, I switched back to Authentication method: API and it still did not work. I hope this helps determine what the issue is!

    Kari

    Anonymous User 12640152

    (@anonymized-12640152)

    Hi @karisharp,

    Which permissions does you API Key have?

    Thank you,
    SendGrid

    @team-rs It looks like you’re using the V2 API endpoint to send messages when using the API:

    From class-sendgrid-api.php:
    const URL = "https://api.sendgrid.com/api/mail.send.json";

    But according to these docs on your site API keys are only supported on the V3 API and later.

    I tried just switching the URL to a V3 URL, and that didn’t work, but my error changed from an HTTP 400 to an HTTP 401.

    Update: It seems that getting a new API key started things working. Both keys have the same permissions, I’m not sure why one works and the other doesn’t.

    • This reply was modified 7 years, 10 months ago by johnnyb. Reason: Found a solution

    Update again: Be very, very, sure that you have no extra white space around your API key when you paste it into the API Key box on the settings page. I had a space at the beginning of the API key and that was causing the trouble. When I found & removed the space the old API key that didn’t work before started working.

    @team-rs: Could you trim() the API key at some point? Since it’s masked as a password white-space is a very hard error to catch.

    Anonymous User 12640152

    (@anonymized-12640152)

    Hi @johnnyb,

    Thanks for you feedback. In the next versions we will apply function trim() to the API Key.

    Thanks,
    SendGrid

    I had the same experience as Kari: I got it to work using username/password but when I switched back to API it didn’t work. It turned out John Beales was right– I had a blank space at the beginning. Unfortunately the way SendGrid displays the API key the one time they show it makes it very hard to select just the characters. I found the space by pasting first into TextEdit before copying the key into WP. Adding trim() should help with this issue.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Email wasn’t sent’ is closed to new replies.