Support » Plugin: Post SMTP Mailer/Email Log » php7.2 upgrade Sendgrid Failure

  • Resolved Stu

    (@dblinks)


    I cannot send test email with my setup. Worked fine before server upgrade PHP7.2

    2019/05/06 18:25:10 [error] 31602#31602: *4034 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined function SendGrid\mb_convert_encoding() in /a1srv/mydomain/wp-content/plugins/post-smtp/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/lib/helpers/mail/Mail.php:745
    Stack trace:
    #0 /a1srv/mydomain/wp-content/plugins/post-smtp/Postman/Postman-Mail/PostmanSendGridMailEngine.php(91): SendGrid\Content->__construct(‘text/plain’, ‘Hello!\r\rSent by…’)
    #1 /a1srv/mydomain/wp-content/plugins/post-smtp/Postman/PostmanWpMail.php(200): PostmanSendGridMailEngine->send(Object(PostmanMessage))
    #2 /a1srv/mydomain/wp-content/plugins/post-smtp/Postman/PostmanWpMail.php(55): PostmanWpMail->sendMessage(Object(PostmanMessage), Object(PostmanEmailLog))
    #3 /a1srv/mydomain/wp-content/plugins/post-smtp/Postman/PostmanWpMailBinder.php(116): PostmanWpMail->send(‘me@mydomain.com’, ‘Postman SMTP Te…’, ‘Content-Type: t…’, ‘Content-Type: m…’, Array)
    #4 /a1srv/mydomain/wp-content/plugins/post-smtp/Postman/Postman-Send-Test-Email” while reading response header from upstream, client: 98.xxx.69.xxx, server: mydomain.com, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, upstream: “fastcgi://unix:/var/run/ajenti-v-php7.2-fcgi-mydomain-php7.2-fcgi-0.sock:”, host: “mydomain.com”, referrer: “https://mydomain.com/wp-admin/admin.php?page=postman%2Femail_test”

Viewing 9 replies - 1 through 9 (of 9 total)
  • This is the exact same server setup as we use in dozens of production sites that have php7.0 (php7.0-fpm) on Ubuntu 16.04 with NGINX. The mail continues to send perfectly from other plugins and the Post SMTP test email tool.

    Across the board on a new server none of the sendgrid emails send, the test email tool presents the red “Ajax Error” and the php output above in my first issue. The only difference on this server is it is PHP7.2 Ubuntu 18.04 NGINX

    • This reply was modified 9 months, 3 weeks ago by Stu.

    Update

    Sending the message: Failed (was ajax error previously)
    Status: 401

    I installed mbstring for php7.2 after reading about similar server errors. Now it says just “Failed” instead of “Ajax Error”.

    It appears mcrypt is not supported in php7.2. Is mcrypt a requirement of the plugin?

    thanks!
    stu

    Plugin Author yehudah

    (@yehudah)

    I did the tests with 7.2 a few times and did again now.

    Can you enable wp_debug and try again?

    The debug log is not big, just these lines.

    [08-May-2019 13:27:03 UTC] ERROR PostmanWpMail: Exception code=0 message=ERROR: Status code is 401
    [08-May-2019 13:27:03 UTC] ERROR PostmanSendTestEmailAjaxController: Test Email NOT delivered to server – 0

    Similar to the PHP error log.

    2019/05/08 09:09:05 [error] 26337#26337: *129 FastCGI sent in stderr: “PHP message: ERROR PostmanWpMail: Exception code=0 message=ERROR: Status code is 401
    PHP message: ERROR PostmanSendTestEmailAjaxController: Test Email NOT delivered to server – 0” while reading response header from upstream, client: 98.xxx.69.xxx, server: server.com, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, upstream: “fastcgi://unix:/var/run/ajenti-v-php7.2-fcgi-domain-php7.2-fcgi-0.sock:”, host: “server.com”, referrer: “https://server.com/wp-admin/admin.php?page=postman%2Femail_test”

    thanks
    stu

    I “reset” the plugin with your built in tool. I think settings from the old server or database conflicted. I reset the Sendgrid API Key. All is working fine now. Sorry to be trouble, thanks for a great plugin.

    stu

    Plugin Author yehudah

    (@yehudah)

    So happy to hear, you saved me a few hours of code testing 🙂

    So now I’m back to and issue on our server using NGINX and PHP7.0 these have been in service at least 3 years with your plugin, so since 2.0.1 we have probably 30 sites failing on 2 machines like this, no other errors getting “$emailAddress must be valid and of type string.”

    I reset the sendgrid api key and reset the plugin using your tool like I did above in the original ticket. no go:(

    Errors are one from your test email tool and one from a form onsite:

    2019/05/17 11:23:01 [error] 57873#57873: *1856365 FastCGI sent in stderr: “PHP message: ERROR PostmanWpMail: SendGrid\Mail\TypeException code=0 message=$emailAddress must be valid and of type string.
    PHP message: ERROR PostmanSendTestEmailAjaxController: Test Email NOT delivered to server – 0” while reading response header from upstream, client: 208.xx.36.xxx, server: domain.com, request: “POST /wp-admin/admin-ajax.php HTTP/1.1”, upstream: “fastcgi://unix:/var/run/ajenti-v-php7.0-fcgi-domainsa1-php7.0-fcgi-0.sock:”, host: “domain.com”, referrer: “https://domain.com/wp-admin/admin.php?page=postman%2Femail_test”

    2019/05/17 11:21:30 [error] 57874#57874: *1856281 FastCGI sent in stderr: “PHP message: ERROR PostmanWpMail: SendGrid\Mail\TypeException code=0 message=$emailAddress must be valid and of type string.
    PHP message: ERROR PostmanWpMail: SendGrid\Mail\TypeException code=0 message=$emailAddress must be valid and of type string” while reading response header from upstream, client: 208.xx.36.xxx, server: domain.com, request: “POST /contact-us/ HTTP/1.1”, upstream: “fastcgi://unix:/var/run/ajenti-v-php7.0-fcgi-domainsa1-php7.0-fcgi-0.sock:”, host: “domain.com”, referrer: “https://domain.com/contact-us/”

    I have restarted php and nginx, disabled other plugins still cannot get it to work.

    We all appreciate your hard work on this now I’m a bit lost hoping there is a fix.

    thx
    stu

    This appears to work from your other support thread:

    throw new TypeException(
    ‘{$emailAddress} must be valid and of type string.’
    );
    }

    What is incredibly strange the new plugin works on some sites with the same setup. Now I’m totally confused.

    thx
    stu

    NO I am wrong. That code is not working. Is is supposed to be between single (‘) marks or in your example you show double (“) ???

    I rolled back to 1.9.7 – That definitely works for me now.

    thx
    stu

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘php7.2 upgrade Sendgrid Failure’ is closed to new replies.