Search code examples
phpcomposer-phpwindows-server-2016iis-10mailjet

Error 500 on Post request using MailJet Wrapper in Php on a window 2016 server


I have used the standard MailJet wrapper and php script to produce an email from our website. We are using the php wrapper for this. I installed the wrapper using composer so believe we have all the correct dependencies. When executing the script it works up until the following line:

$response = $mj->post(Resources::$Email, ['body' => $body]);

We have input the correct API and Secret keys and are running php 7.3.13 on the server.

I believe the code is correct as if i copy the website onto a shared Linux server it all runs to completion and we receive an email. I suspect that there is a flag or standard php add on we might require that is available on our shared server but not the windows one.

We just did a bog standard install of php on the server using the web platform installer as was recommended.

If anyone has any ideas as to what could be missing i would be grateful! Im not big on php so apologies if it is something stupid.

Thanks,

Simon


Solution

  • Thanks for helping, after getting to the logs i found that i needed to update the settings for curl in my php.ini file to point to the cacert File i downloaded from their website. Now this is set its running and sending messages.