Hi, I would like to set up a custom smtp server for the php mail() function only for one website. I've tried to add those lines into "Custom php.ini directives"; Code: SMTP="mail.smtp2go.com" smtp_port="2525" When I run phpinfo(), I see that the values have changed. I then ran the script to send the email and I received it. BUT, when I check the headers of the email, its still sent by local postfix and not from the custom SMTP specified in php.ini. Am I doing something wrong? Thank you very much for your help
It might be that these settings are recognized by PHP on Windows only. Is the app that you use in that site not able to use SMTP to send email instead of the mail() function?
Im using a plugin for all our CMS/WordPress websites that allow me to send trough SMTP like you mentionned, so I never had the problem before. In this case, its a custom made website that use the really basic php mail() function and I have to find a way to send these emails using their smtp2go account. Is there something that I can do?
Something like this might work: https://github.com/smalot/sendmail-smtp you don't edit the php.ini in this case, use the php.ini field of the website to set the path to the sendmail wrapper script.
Thanks for your replies till, it helps a lot. Do you think that will cause problems with future updates? If I understand, I can install this "sendmail copy" with smtp support and only use it for this website by configuring the sendmail_path into the custom php.ini directives. I do not want to replace the "real" sendmail in the default php.ini so that other websites are not affected right?
Hi till, I tested it right away. But it seems that the sendmail_path value does not want to change. I entered into custom php.ini settings, is that what you meant by php.ini field of the website? Code: sendmail_path = "/etc/sendmail-smtp/sendmail.phar -f /etc/sendmail-smtp/smtp2go.yml" I checked with phpinfo() and it returns the default value which is Code: /usr/sbin/sendmail -t -i -f [email protected] Do you know why it does not change?
I am on Fast-CGI PHP 5.6, it is default setting in my case. I tried with PHP-FPM too, but no luck. If necessary, I can switch to another mode. I took my time to search in the forums and it seems to be an hard one to change. The only thing I found is parameters in a file named .php-fcgi-starter. Maybe you have the trick to do it.