phpmailerHow do I configure PHPMailer to use TLS 1.2?
- Download and install PHPMailer.
- Create a
PHPMailerinstance and set theSMTPSecureproperty to'tls':
$mail = new PHPMailer;
$mail->SMTPSecure = 'tls';
- Set the
SMTPAutoTLSproperty totrueto enable TLS 1.2:
$mail->SMTPAutoTLS = true;
- Set the
Hostproperty to the SMTP hostname and port of your email provider:
$mail->Host = 'smtp.example.com:587';
- Set the
SMTPAuthproperty totrueif your email provider requires authentication:
$mail->SMTPAuth = true;
- Set the
UsernameandPasswordproperties if authentication is required:
$mail->Username = 'username';
$mail->Password = 'password';
- Send the email using the
send()method.
Helpful links
More of Phpmailer
- How can I use PHPMailer without SMTP secure?
- How do I use PHPMailer to attach a ZIP file?
- How can I configure PHPMailer to work with GoDaddy?
- How can I use PHPMailer in Yii 1?
- How can I use PHPMailer with XAMPP on a localhost?
- How can I use PHPMailer with XAMPP on Windows?
- How can I use PHPMailer to send emails through Outlook?
- How can I use PHPMailer to send emails with a Yahoo account?
- How do I view the log for my PHPMailer emails?
- How can I send emails using PHPMailer without using SMTP?
See more codes...