IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Symfony PHP Discussion :

Pas d'envoi d'email depuis le FOSUserBundle


Sujet :

Symfony PHP

  1. #1
    Membre averti Avatar de Neolex
    Homme Profil pro
    Recherche emploi Securité informatique
    Inscrit en
    Avril 2011
    Messages
    243
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Recherche emploi Securité informatique

    Informations forums :
    Inscription : Avril 2011
    Messages : 243
    Points : 333
    Points
    333
    Par défaut Pas d'envoi d'email depuis le FOSUserBundle
    Bonsoir à tous ,
    je me permets de poster un message car je bloque sur la configuration de Symfony...

    J'ai configuré l'email et j'arrive à en envoyer depuis la console en faisant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $php bin/console swiftmailer:email:send
    Je reçois bien le mail que j'envoie .
    Cependant je n'arrive pas a faire en sorte que mon UserBundle héritant de FOSUserBundle en envoie .

    Il y à marqué que le mail est envoyé mais je n'en reçoit aucun , j'ai bien verifié mon dossier spam il est vide aussi.

    J'aurais donc besoin de votre aide , s'il vous plaît !

    Voici mes different fichiers de configuration :
    mon app/config.yml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    imports:
        - { resource: parameters.yml }
        - { resource: security.yml }
        - { resource: services.yml }
        - { resource: "@CouchsurfBundle/Resources/config/services.yml" }
     
    # Put parameters here that don't need to change on each machine where the app is deployed
    # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
    parameters:
        locale: en
     
    framework:
        #esi:             ~
        translator:      { fallbacks: ["%locale%"] }
        secret:          "%secret%"
        router:
            resource: "%kernel.root_dir%/config/routing.yml"
            strict_requirements: ~
        form:            ~
        csrf_protection: ~
        validation:      { enable_annotations: true }
        #serializer:      { enable_annotations: true }
        templating:
            engines: ['twig']
        default_locale:  "%locale%"
        trusted_hosts:   ~
        trusted_proxies: ~
        session:
            # http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
            handler_id:  session.handler.native_file
            save_path:   "%kernel.root_dir%/../var/sessions/%kernel.environment%"
        fragments:       ~
        http_method_override: true
        assets: ~
     
    # Twig Configuration
    twig:
        debug:            "%kernel.debug%"
        strict_variables: "%kernel.debug%"
     
    # Doctrine Configuration
    doctrine:
        dbal:
            driver:   pdo_mysql
            host:     "%database_host%"
            port:     "%database_port%"
            dbname:   "%database_name%"
            user:     "%database_user%"
            password: "%database_password%"
            charset:  UTF8
            # if using pdo_sqlite as your database driver:
            #   1. add the path in parameters.yml
            #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
            #   2. Uncomment database_path in parameters.yml.dist
            #   3. Uncomment next line:
            #     path:     "%database_path%"
     
        orm:
            auto_generate_proxy_classes: "%kernel.debug%"
            naming_strategy: doctrine.orm.naming_strategy.underscore
            auto_mapping: true
     
    # Swiftmailer Configuration
    swiftmailer:
        transport: "%mailer_transport%"
        host:      "%mailer_host%"
        username:  "%mailer_user%"
        password:  "%mailer_password%"
        port: 587
        auth_mode : login
        encryption: tls
        spool:     { type: memory }
     
     
     
    fos_user:
        db_driver: orm
        firewall_name: main
        user_class: UserBundle\Entity\User
        registration:
            confirmation:
                enabled:    true
        from_email:
            address:    adresseEmail@gmail.com
            sender_name:  CouchSurf
        service:
            mailer:               fos_user.mailer.default
            email_canonicalizer:  fos_user.util.canonicalizer.default
            token_generator:      fos_user.util.token_generator.default
            username_canonicalizer:  fos_user.util.canonicalizer.default
            user_manager:         fos_user.user_manager.default
     
     
    assetic:
        debug:          '%kernel.debug%'
        use_controller: '%kernel.debug%'
        filters:
            cssrewrite: ~
     
    # ...

    config_dev.yml :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    imports:
        - { resource: config.yml }
     
    framework:
        router:
            resource: "%kernel.root_dir%/config/routing_dev.yml"
            strict_requirements: true
        profiler: { only_exceptions: false }
     
    web_profiler:
        toolbar: true
        intercept_redirects: true   # the default value is false replace it with true in order to enable the profiler debugger
     
    monolog:
        handlers:
            main:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
                channels: [!event]
            console:
                type:   console
                channels: [!event, !doctrine]
            # uncomment to get logging in your browser
            # you may have to allow bigger header sizes in your Web server configuration
            #firephp:
            #    type:   firephp
            #    level:  info
            #chromephp:
            #    type:   chromephp
            #    level:  info
    parameters.yml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    # This file is auto-generated during the composer install
    parameters:
        database_host: 127.0.0.1
        database_port: null
        database_name: surfcouch
        database_user: root
        database_password: dahlia
        mailer_transport: smtp
        mailer_host: smtp.gmail.com
        mailer_user: adresse@gmail.com
        mailer_password: monpassword 
        secret: 3d096e67f634afe14a3c7ca3f9721970d8ca52fa

  2. #2
    Membre expert
    Avatar de dukoid
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2012
    Messages
    2 100
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Novembre 2012
    Messages : 2 100
    Points : 3 004
    Points
    3 004
    Par défaut
    va voir dans les logs Symfony si il y a peut être une erreur d'envois du mail.

    /app/log
    ou
    /var/log

  3. #3
    Membre averti Avatar de Neolex
    Homme Profil pro
    Recherche emploi Securité informatique
    Inscrit en
    Avril 2011
    Messages
    243
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Recherche emploi Securité informatique

    Informations forums :
    Inscription : Avril 2011
    Messages : 243
    Points : 333
    Points
    333
    Par défaut
    Bonsoir ,
    merci de ta réponse , j'ai regardé les logs mais je ne trouve rien de spécial ...
    Les voici :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    [2016-11-13 18:27:16] request.INFO: Matched route "{route}". {"route":"root","route_parameters":{"_controller":"Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction","path":"/en/","permanent":true,"_route":"root"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/","method":"GET"} []
    [2016-11-13 18:27:16] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:17] request.INFO: Matched route "{route}". {"route":"homepage","route_parameters":{"_controller":"Couchsurf\\CouchsurfBundle\\Controller\\DefaultController::homepageAction","_locale":"en","_route":"homepage"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/en/","method":"GET"} []
    [2016-11-13 18:27:17] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:17] request.INFO: Matched route "{route}". {"route":"_wdt","route_parameters":{"_controller":"web_profiler.controller.profiler:toolbarAction","token":"01a94b","_route":"_wdt"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/_wdt/01a94b","method":"GET"} []
    [2016-11-13 18:27:17] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:23] request.INFO: Matched route "{route}". {"route":"fos_user_security_login","route_parameters":{"_controller":"FOS\\UserBundle\\Controller\\SecurityController::loginAction","_locale":"en","_route":"fos_user_security_login"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/en/login","method":"GET"} []
    [2016-11-13 18:27:23] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:23] translation.WARNING: Translation not found. {"id":"ser.login.noti_ins","domain":"FOSUserBundle","locale":"en"} []
    [2016-11-13 18:27:23] translation.WARNING: Translation not found. {"id":"user.login.noti_instext","domain":"FOSUserBundle","locale":"en"} []
    [2016-11-13 18:27:24] request.INFO: Matched route "{route}". {"route":"_wdt","route_parameters":{"_controller":"web_profiler.controller.profiler:toolbarAction","token":"bee8d1","_route":"_wdt"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/_wdt/bee8d1","method":"GET"} []
    [2016-11-13 18:27:24] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:25] request.INFO: Matched route "{route}". {"route":"fos_user_resetting_request","route_parameters":{"_controller":"FOS\\UserBundle\\Controller\\ResettingController::requestAction","_locale":"en","_route":"fos_user_resetting_request"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/en/resetting/request","method":"GET"} []
    [2016-11-13 18:27:25] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:25] request.INFO: Matched route "{route}". {"route":"_wdt","route_parameters":{"_controller":"web_profiler.controller.profiler:toolbarAction","token":"23d4cf","_route":"_wdt"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/_wdt/23d4cf","method":"GET"} []
    [2016-11-13 18:27:25] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:28] request.INFO: Matched route "{route}". {"route":"fos_user_resetting_send_email","route_parameters":{"_controller":"FOS\\UserBundle\\Controller\\ResettingController::sendEmailAction","_locale":"en","_route":"fos_user_resetting_send_email"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/en/resetting/send-email","method":"POST"} []
    [2016-11-13 18:27:28] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:28] doctrine.DEBUG: SELECT t0.username AS username_1, t0.username_canonical AS username_canonical_2, t0.email AS email_3, t0.email_canonical AS email_canonical_4, t0.enabled AS enabled_5, t0.salt AS salt_6, t0.password AS password_7, t0.last_login AS last_login_8, t0.locked AS locked_9, t0.expired AS expired_10, t0.expires_at AS expires_at_11, t0.confirmation_token AS confirmation_token_12, t0.password_requested_at AS password_requested_at_13, t0.roles AS roles_14, t0.credentials_expired AS credentials_expired_15, t0.credentials_expire_at AS credentials_expire_at_16, t0.id AS id_17, t0.name AS name_18, t0.lastname AS lastname_19, t0.city AS city_20, t0.country AS country_21 FROM users t0 WHERE t0.username_canonical = ? LIMIT 1 ["neolex"] []
    [2016-11-13 18:27:28] doctrine.DEBUG: "START TRANSACTION" [] []
    [2016-11-13 18:27:28] doctrine.DEBUG: UPDATE users SET password_requested_at = ? WHERE id = ? ["2016-11-13 18:27:28",1] []
    [2016-11-13 18:27:28] doctrine.DEBUG: "COMMIT" [] []
    [2016-11-13 18:27:29] request.INFO: Matched route "{route}". {"route":"fos_user_resetting_check_email","route_parameters":{"_controller":"FOS\\UserBundle\\Controller\\ResettingController::checkEmailAction","_locale":"en","_route":"fos_user_resetting_check_email"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/en/resetting/check-email?username=neolex","method":"GET"} []
    [2016-11-13 18:27:29] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    [2016-11-13 18:27:30] request.INFO: Matched route "{route}". {"route":"_wdt","route_parameters":{"_controller":"web_profiler.controller.profiler:toolbarAction","token":"6aeffe","_route":"_wdt"},"request_uri":"http://localhost/couchsurf/web/app_dev.php/_wdt/6aeffe","method":"GET"} []
    [2016-11-13 18:27:30] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
    Edit :
    Je ne comprends pas je n'ai rien changé et ce soir ça fonctionne :o

  4. #4
    Membre expert
    Avatar de dukoid
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Novembre 2012
    Messages
    2 100
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Novembre 2012
    Messages : 2 100
    Points : 3 004
    Points
    3 004
    Par défaut
    après, quand tu touches aux conf faut toujours vider le cache

  5. #5
    Membre averti Avatar de Neolex
    Homme Profil pro
    Recherche emploi Securité informatique
    Inscrit en
    Avril 2011
    Messages
    243
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 30
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : Recherche emploi Securité informatique

    Informations forums :
    Inscription : Avril 2011
    Messages : 243
    Points : 333
    Points
    333
    Par défaut
    Ah oui , j'avais oublié ça !
    Merci

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [1.x] Problèmes avec l'envoi d'email depuis une task
    Par nsoinard dans le forum Symfony
    Réponses: 2
    Dernier message: 21/04/2010, 14h57
  2. Réponses: 2
    Dernier message: 21/07/2009, 10h55
  3. Script envoi d'email depuis shell - uuencode
    Par germain.proges dans le forum Shell et commandes GNU
    Réponses: 4
    Dernier message: 20/04/2009, 11h55
  4. Réponses: 3
    Dernier message: 09/01/2009, 15h34
  5. envoi d'email depuis Excel
    Par Debutante-Excel dans le forum Excel
    Réponses: 5
    Dernier message: 10/03/2008, 10h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo