T
T
Tat622020-01-18 16:09:46
Yii
Tat62, 2020-01-18 16:09:46

Why do I get the error "Failed to authenticate to SMTP server" when sending email to Azure via Sendgrid?

At the moment, I have configured mail forwarding as suggested in the Azure reference documentation for the Sendgrid resource on a windows server 2012 virtual machine with iis8
Transport:

'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
'transport' => [
'class' => 'Swift_SmtpTransport', 
'host' => 'smtp.sendgrid.net',
'username' => 'ххххххх',
'password' => 'ххххххх',
'port' => '587', 
'encryption' => 'tls',
],

Message:
if  (  ! Yii :: $ app-> mailer
                    -> compose ('signup-ok', ['password' => $ password, 'user' => $ user])
                    -> setTo ($ user-> email)
                    -> setFrom ( [Yii :: $ app-> params ['fromEmail'] => 'XXXXXXX.ru'])
                    -> setSubject ('XXXXXXXXXXXX.ru')
                    -> send ()
            ) {
                throw new \ DomainException ('Ошибка отправки сообщения « );
            }

However, this gives an error message:
Failed to authenticate to the SMTP server with username 'xxxxxx' using 2 possible authentication methods. The LOGIN authenticator returned the expected response code 250, but received an empty response. The PLAIN authenticator returned the expected response code 250, but received an empty response.
Prompt, please, in what there can be a business. Maybe I did not correctly specify the username and password for the transport. Then what should be specified in these parameters. I will be glad for any help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-01-18
@dimonchik2013

decompose
well from the message
client, take a simple client, check the credentials

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question