How to configure SMTP on symfony 4 using swiftmailer?

I’m working on a project which includes emails sending with swiftmailer withing my application based on symfony4, in development period I was using gmail to send email, it was working well, however when I changed the mailer_url to set up smtp parameter, it wouldnt work, I dont know why, and the same credentials are working in webmailer, but not in my application, e-mails are not sent.
it doesnt show any error on the log file, but when I use encryption=ssl it gives me this error on log :

php.WARNING: Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed {"exception":"[object] (ErrorException(code: 0): Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:nerror:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed at /home/admin/web/myhost.com/public_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:94)"} []

this is the mailer_url I’m doing at the moment :

MAILER_URL=smtp://localhost:25?auth_mode=login&[email protected]&password=mypassword

I’m stuck at this point, I dont know if I need to set up something on the server hosting my application, or if I need to configure something that I forgot.

Thanks in advance.

Source: Symfony4 Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *