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.
You have to activate "POP3 and IMAP access" on web.de. So log in to web.de webmail under "Settings" -> "POP3/IMAP Retrieval".
I've done it
Here is the associated PHP code:
Apparently the server doesn't like the credentials.
You specified the username correctly and including domain?
yes, as follows: mustermann@web.de The login details are 100% correct
If the same data (encoding problems excluded?) work in another client or the like, but not in PHPMailer, then a bug remains.
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?
Sry, I'm afraid I don't know how to do that.
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
On the website there is a "contact" area where once you have these fields:
has filled out, you press on to send and then the mail should be sent to my webmail. I'm a beginner, and I've been looking for it on the net.
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
Here is a Tip for PHP Form Validation
https://www.w3schools.com/php/php_form_validation.asp
The answer is your question. Check the error message again. Your credentials are wrong.
I can't start so much with the error message. I'm a beginner. But the login details are 100% correct. I have checked several times and re-entered once.
Error 535 says that authentication has failed. What this means is that username or password are incorrect.
Exchange this line
against