SMTP email
authentication failure [SMTP: Invalid response code received from server (code: 535, response: Incorrect authentication data)]
How to send SMTP email in PHP?
Share
SMTP email
authentication failure [SMTP: Invalid response code received from server (code: 535, response: Incorrect authentication data)]
The first thing you can learn HTML, whether you want to become a professional web developer or just want to learn more about how websites work. The basic language for developing web pages and web applications is HTML. A server ...
Asynchronous Javascript One of AJAX’s benefits is it provides instantaneous feedback to the user because it requests information asynchronously from the backend web server. However, using AJAX does not guarantee the user will not wait for the asynchronous JavaScript and ...
How To Make Cookie Free Domain An HTTP cookie (also known as a web cookie, Internet cookie, browser cookie, or simply cookie) is a small piece of data sent from a website and stored on the user’s computer by the ...
Would you please recheck your configuration settings? It seems the SMTP is not configured correctly.
Brother no idea about SMTP configuration
You have to use the correct credentials for sending the email using SMTP. You can find the configuration under te SMTPmailler.php which you have included to send the mails.
this is my code
ini_set(”include_path”, ’/home/sitename/php:’ . ini_get(”include_path”) );
require_once ”Mail.php”;
$from = ’email’;
$to = ’email’;
$subject = ’Hi!’;
$body = ”Hi,\n\nHow are you?”;
$headers = array(
’From’ => $from,
’To’ => $to,
’Subject’ => $subject
);
$smtp = Mail::factory(’smtp’, array(
’host’ => ’mailhost’,
’port’ => ’25’,
’auth’ => true,
’username’ => ’email’,
’password’ => ’pass’
));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo(’’ . $mail->getMessage() . ’’);
} else {
echo(’Message successfully sent!’);
}
}
$smtp = Mail::factory(’smtp’, array(
’host’ => ’mailhost’,
’port’ => ’25’,
’auth’ => true,
’username’ => ’email’,
’password’ => ’pass’
));
This is the main function. You have to use the real host, username and password instead of these dummy credentials. Like if you are having gmail account then it should be:
Host: smtp.gmail.com
Post: 465
Username: [email protected]
Password: Your gmail account password.
Hope it will help you!
i am applying in my website not in gmail.
Yes, I know. SMPT works on websites. But you have to use the live credentials for sending emails from your server.