Silverstripe Version: 5
Question:
I have just updated an old silverstripe 3 site to silverstripe 5. Everything is good except that it does not send emails. I have tried adding the following .env variables:
MAILER_DSN="smtp://user@domain.com:password@mail.domain.com:465"
MAILER_DSN="smtp://user@domain.com:password@smtp.domain.com:587"
MAILER_DSN="sendmail://default"
I have run dev/build?flush=all after each change. At best I get error messages and at worst it is an internal server error and nothing gets written to the error log.
I have also tried adding a mailer-project.yml file with the following in it:
---
Name: mailer-project
After: 'mailer'
---
SilverStripe\Core\Injector\Injector:
Symfony\Component\Mailer\Transport\TransportInterface:
constructor:
dsn: '%env(MAILER_DSN)%'
The error messages I have gotten are:
# [Emergency] Uncaught Symfony\Component\Mailer\Exception\InvalidArgumentException: The mailer DSN must contain a scheme.
ERROR: Uncaught Exception Error: "Call to undefined function Symfony\Component\Mailer\Transport\Smtp\Stream\proc_open()" at /home/mcscomau/public_html/vendor/symfony/mailer/Transport/Smtp/Stream/ProcessStream.php line 41 {"exception":"[object] (Error(code: 0): Call to undefined function Symfony\\Component\\Mailer\\Transport\\Smtp\\Stream\\proc_open() at /home/.../public_html/vendor/symfony/mailer/Transport/Smtp/Stream/ProcessStream.php:41)"} []
What am I missing? I have not used Silverstripe much in the last year or two, so I am a bit rusty with it all.
Thanks