Send mail via PHP Mailer?

Good Morning,

I wanted to send an email via web.de and now I get the following error message and cannot find a solution:

2023-05-08 19:51:49 SERVER -> CLIENT: 220 web.de (mrweb006) Nemesis ESMTP Service ready

2023-05-08 19:51:49 CLIENT -> SERVER: EHLO localhost

2023-05-08 19:51:50 SERVER -> CLIENT: 250-web.de Hello localhost [178.24.229.10]250-8BITMIME250-SIZE 141557760250 STARTTLS

2023-05-08 19:51:50 CLIENT -> SERVER: STARTTLS

2023-05-08 19:51:50 SERVER -> CLIENT: 220 OK

2023-05-08 19:51:50 CLIENT -> SERVER: EHLO localhost

2023-05-08 19:51:50 SERVER -> CLIENT: 250-web.de Hello localhost [178.24.229.10]250-8BITMIME250-AUTH LOGIN PLAIN250 SIZE 141557760

2023-05-08 19:51:50 CLIENT -> SERVER: AUTH LOGIN

2023-05-08 19:51:50 SERVER -> CLIENT: 334 VXNlcm5hbWU6

2023-05-08 19:51:50 CLIENT -> SERVER: [credentials hidden]

2023-05-08 19:51:50 SERVER -> CLIENT: 334 UGFzc3dvcmQ6

2023-05-08 19:51:50 CLIENT -> SERVER: [credentials hidden]

2023-05-08 19:51:50 SERVER -> CLIENT: 535 Authentication credentials invalid

2023-05-08 19:51:50 SMTP ERROR: Password command failed: 535 Authentication credentials invalid

SMTP Error: Could not authenticate.

2023-05-08 19:51:50 CLIENT -> SERVER: QUIT

2023-05-08 19:51:50 SERVER -> CLIENT: 221 web.de Service closing transmission channel

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Email could not be sent. Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Does anyone have any ideas what I can do? My email login information is correct, as is the email itself and the paths to the PHP files.

1 vote, average: 1.00 out of 1 (1 rating, 1 votes, rated)
You need to be a registered member to rate this.
Loading...
Subscribe
Notify of
15 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
mike230101
1 year ago

You have to activate "POP3 and IMAP access" on web.de. So log in to web.de webmail under "Settings" -> "POP3/IMAP Retrieval".

KarlRanseierIII
1 year ago
Reply to  InfoBeginner

Apparently the server doesn't like the credentials.

You specified the username correctly and including domain?

KarlRanseierIII
1 year ago

If the same data (encoding problems excluded?) work in another client or the like, but not in PHPMailer, then a bug remains.

KuarThePirat
1 year ago

Unfortunately, I can only help to a limited extent here… if the login data is correct and thus the shipping works in Thunderbird or the like, then something is wrong in the implementation of PHPMailer. Have you ever tried to implement communication with the SMTP server yourself?

NackterGerd
1 year ago

ERROR: Password command failed: 535 Authentication credentials invalid

Here's something wrong with your SMPT

I wonder what you're going to do.

You can also use PHP directly mail() to send mails from the server, for example, to edit forms and send them by email

NackterGerd
1 year ago
Reply to  InfoBeginner

I use the simple mail function

https://www.php.net/manual/de/function.mail.php

However, you should always check data from the form before you continue using it

Otherwise, hackers can easily trick you or worse your site to hack

NackterGerd
1 year ago

Here is a Tip for PHP Form Validation

https://www.w3schools.com/php/php_form_validation.asp

HoiZusammen
1 year ago

The answer is your question. Check the error message again. Your credentials are wrong.

HoiZusammen
1 year ago
Reply to  InfoBeginner

Error 535 says that authentication has failed. What this means is that username or password are incorrect.

Exchange this line

 $mail->SMTPSecure = 'TLS';

against

 $mail->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS;