E
E
Evgeny Ivanov2021-12-06 10:21:27
PHP
Evgeny Ivanov, 2021-12-06 10:21:27

How to set up PHP mailer correctly?

There are no questions about the script.
But I can't send email from any service.

The error output says this.

Invalid login or password\r\n","SMTP ERROR: Password command failed: 535 5.7.0 Invalid login or password\r\n","SMTP Error: Could not authenticate.","CLIENT -> SERVER: QUIT\r\n


I'm sure I'm entering the correct username/password.

I'm interested in these settings.
Preferably for Yandex, Rambler, Google mail.
How to specify them correctly (manuals on the Internet did not help)?

$mail->Host = 'ssl://smtp.rambler.ru';
$mail->Username = '[email protected]';
$mail->Password = 'a1234567';
$mail->SMTPSecure = 'ssl';
$mail->Port       = 465;
$mail->setFrom('[email protected]', 'Имя отправителя'); 

// Получатель письма
$mail->addAddress('[email protected]');  
$mail->addAddress('[email protected]'); // Ещё один, если нужен

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FanatPHP, 2021-12-06
@FanatPHP

Before configuring the mail client, in the "Settings" menu of the mailbox on the "Mail Programs" tab, you must check the box in the item "I want to access the mailbox using the mail client."
https://help.rambler.ru/mail/mail-pochtovye-client...

And besides that, you should never pretend to be someone else. Phishing can be painfully beaten with sticks. The times when you could substitute any address in from are long gone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question