Symfony2: error trying to send email using Swiftmailer

I have the following problem when I try to send an email with a quick Symfony2 project: An exception occurred while cleaning the email queue: the expected response code is 220, but received the code "with message".

I am in localhost and I am trying to use my OVH host mail. Here is my config.yml:

# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    auth_mode: "%mailer_auth_mode%"
    host:      "%mailer_host%"
    port:      "%mailer_port%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }

And my .yml options:

# This file is auto-generated during the composer install
parameters:
    database_driver: pdo_mysql
    database_host: 127.0.0.1
    database_port: null
    database_name: ********
    database_user: root
    database_password: null
    mailer_transport: mail
    mailer_auth_mode: login
    mailer_host:  ns0.ovh.net
    mailer_port: 587
    mailer_user: contact@******.com
    mailer_password: **********
    locale: fr
    secret: ThisTokenIsNotSoSecretChangeIt

thank

+4
source share
1 answer

What version of SwiftMailer have you installed? Mail transport is deprecated from SwiftMailer 5.4.5.

SwiftMailer 5.4.5, 6. , smtp, sendmail gmail.

:

https://symfony.com/doc/current/reference/configuration/swiftmailer.html#transport

http://symfony.com/doc/current/email.html

mailer_transport. , , , ...

parameters.yml

parameters:
    mailer_transport: smtp
    mailer_host: smtp.example.com
    mailer_user: user@example.com
    mailer_password: my_password
    mailer_port: 587
    mailer_encryption: tls
0

All Articles