2
votes

I have configured a service for inbound email with record MX on Sendgrid. When receive email the callback URL has this function:

mail("[email protected]","New Email", "New Email from Sendgrid"); 

and it work perfect, now i need to get the information from email, i have read the documentation:

https://sendgrid.com/docs/API_Reference/Webhooks/parse.html

and it say to use POST, ok i use post for getting the value:

mail("[email protected]","New Email", $_POST['from']); 

in this mode not work, return this error:

PHP Warning: mail() expects parameter 3 to be string, array given in    /home/user/index.php on line 6

Can someone please help me?

1
Look at the error log. That will show you why you are getting the 500 error. A 500 error is just a generic "something went wrong" error that doesn't tell you what went wrong. PHP will still write to the error log what the error was. - Jonathan Kuhn
You may need to enable the mail extension,i guess.. - user4412122
PHP Warning: mail() expects parameter 3 to be string, array given in /home/user/index.php on line 6 - user1038606
You should edit your original question and include the error there, not in a comment. - user773737
Problem solved, with this: github.com/Ziggeo/php-sendgrid-parse and disable Paste RAW data from settings on Sendgrid - user1038606

1 Answers

1
votes

Problem solved, with this: https://github.com/Ziggeo/php-sendgrid-parse

and disable Paste RAW data from settings on Sendgrid