yii2-usuario
yii2-usuario copied to clipboard
can not send mails from usuario but able to send them using mail->compose
What steps will reproduce the problem?
I am trying to sign up using index.php?r=user/registration/register and can not create the user, nor get the email.
the web configuration is:
'mail' => [ 'class' => 'yii\swiftmailer\Mailer', //'viewPath' => '@app/mail', 'useFileTransport' => true, 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'mail.domain.com.mx', 'username' => '[email protected]', 'password' => 'password', 'port' => '465', 'encryption' => 'ssl', ], ],
I understand that usuario does not mess with mail, just uses it, however i am able to send mails using a mail-->compose sentence with the same values at mail configuration
What is the expected result?
an user created and email received to confirm the user
What do you get instead?
in the page i get these messages:
User could not be registered. Error sending registration message to "[email protected]". Please try again later.
in the yii2 log: Process could not be started [El sistema no puede encontrar la ruta especificada. (the system can not find the path specified) ] [C:\MAMP\htdocs\analytics\vendor\2amigos\yii2-usuario\src\User\Traits\MailAwareTrait.php:45] [C:\MAMP\htdocs\analytics\vendor\2amigos\yii2-usuario\src\User\Service\UserRegisterService.php:72] [C:\MAMP\htdocs\analytics\vendor\2amigos\yii2-usuario\src\User\Controller\RegistrationController.php:124]
try to rename mail section to mailer I guess it is a cause of issue 'useFileTransport' => true, - means that email will be saved as a file check the runtime\mail\ folder to find it remove this option if you are using live mail instead
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
it works fine for me https://stackoverflow.com/questions/56390502/swift-transportexception-error-while-signup-in-yii2-advance-template https://www.yiiframework.com/extension/yiisoft/yii2-swiftmailer/doc/api/2.1/yii-swiftmailer-mailer