M
M
michaelromanov902017-02-21 22:12:21
Yii
michaelromanov90, 2017-02-21 22:12:21

How to connect phpmailer(Yii2) and Yandex mail for domain?

prescribing

'mailer' => [
            'class'            => 'zyx\phpmailer\Mailer',
            'viewPath'         => '@common/mail',
            'useFileTransport' => false,
            'config'           => [
                'mailer'     => 'smtp',
                'host'       => 'ssl://smtp.yandex.com',
                'port'       => '587',
                'smtpsecure' => 'TLS',
                'smtpauth'   => true,
                'username'   => '[email protected]',
                'password'   => 'pass',
            ],
        ],

prescribing
'mailer' => [
            'class'            => 'zyx\phpmailer\Mailer',
            'viewPath'         => '@common/mail',
            'useFileTransport' => false,
            'config'           => [
                'mailer'     => 'smtp',
                'host'       => 'ssl://smtp.yandex.com',
                'port'       => '465',
                'smtpsecure' => 'ssl',
                'smtpauth'   => true,
                'username'   => '[email protected]',
                'password'   => 'pass',
            ],
        ],

the result is the same, i.e. no. There are no logs. The letter does not leave.
tried
'host' => 'smtp.yandex.com',
'port' => '25',
and
'port' => '25',
'replyto' => "[email protected]" ,
and
'host' => 'ssl://smtp.yandex.com',
'port' => '465',
'smtpsecure' => 'ssl',
Guys, where am I making a mistake?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
michaelromanov90, 2017-02-21
@michaelromanov90

yes, the mistake is that the sender and the user had to match))
here is a working version, if anyone needs it

'mailer' => [
            'class'            => 'zyx\phpmailer\Mailer',
            'viewPath'         => '@common/mail',
            'useFileTransport' => false,
            'config'           => [
                'mailer'     => 'smtp',
                'host'       => 'smtp.yandex.com',
                'port'       => '465',
                'smtpsecure' => 'ssl',
                'smtpauth'   => true,
                'username'   => '[email protected]домен.ru',
                'password'   => 'пароль',
            ],
        ],

V
Viktor Yanyshev, 2017-02-21
@villiwalla

Purely at random remove ssl:// or why smtp is not in the ru zone?

A
Anton Filippov, 2017-10-28
@Hrederik

$(".rem").on('click', function(){
  $(this).parent().remove();
 })
$(".line").click(function(){
  $(this).toggleClass("show");
})

this does not work correctly, because you need to hang events on the created elements through $(parent).on('click', '.child', fn)
Well, that is, in your case, write $(elem).on('click', '.rem', fn)and $(elem).on('click', '.line', fn), where fn are your callbacks with remove()andtoggleClass()

M
Maxim Kostyukevich, 2017-10-28
@maxisoft

well, the most important reason why it won’t work is that your .rem and .line are not in the DOM tree in such a notation, you can only suggest hanging it on document (global), then even with dynamic addition of elements, everything will work for you. well, or the second option to rewrite like this

var text = $('<p class="line"></p>').on('click', function(){
        $(this).toggleClass("show");
        }).text(val);

$(elem).append('<span class="rem">X</span>').on('click', function(){
  $(this).parent().remove();
 });

You need to bind data to the created elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question