$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.zoho.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'username'; // SMTP username
$mail->Password = 'password'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom('fromemail', 'Mailer');
$mail->addAddress('toemail'
); // Name is optional
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = '123This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
019-08-01 11:59:18 SERVER -> CLIENT: 220 mx.zohomail.com SMTP Server ready August 1, 2019 4:48:50 AM PDT
2019-08-01 11:59:18 CLIENT -> SERVER: EHLO eurostationers.net
2019-08-01 11:59:19 SERVER -> CLIENT: 250-mx.zohomail.com Hello eurostationers.net (ec2-52-58-21-139.eu-central-1.compute.amazonaws.com (52.58.21.139))250-STARTTLS250 SIZE 53477376
2019-08-01 11:59:19 CLIENT -> SERVER: STARTTLS
2019-08-01 11:59:19 SERVER -> CLIENT: 220 Ready to start TLS.
2019-08-01 11:59:19 CLIENT -> SERVER: EHLO eurostationers.net
2019-08-01 12:01:32 SERVER -> CLIENT: 250-mx.zohomail.com Hello eurostationers.net (ec2-52-58-21-139.eu-central-1.compute.amazonaws.com (52.58.21.139))250-AUTH LOGIN PLAIN250 SIZE 53477376
2019-08-01 12:01:32 CLIENT -> SERVER: AUTH LOGIN
2019-08-01 12:01:32 SERVER -> CLIENT:
2019-08-01 12:01:32 SMTP ERROR: AUTH command failed:
SMTP Error: Could not authenticate.
2019-08-01 12:01:32 SMTP NOTICE: EOF caught while checking if connected
SMTP Error: Could not authenticate.