Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not send mails from usuario but able to send them using mail->compose #455

Open
evedder opened this issue Jun 21, 2022 · 1 comment
Open

Comments

@evedder
Copy link

evedder commented Jun 21, 2022

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]

@anton-shynkarenko
Copy link
Contributor

anton-shynkarenko commented Jun 22, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants