1 2 3 4 5 6 7 |
If you want to use TLS, try adding: $mail->SMTPSecure = 'tls'; If you want to use SSL, try adding: $mail->SMTPSecure = 'ssl'; Keep in mind that: |
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
include 'class.phpmailer.php'; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->SMTPSecure = 'ssl'; $mail->SMTPDebug = 0; $mail->AddAddress($mail->Username, 'Information'); $mail->AddReplyTo($email, $name); # kutay zorlu $mail->Username $mail->CharSet = 'UTF-8'; $mail->Subject = $e_subject; $mail->MsgHTML($msg); # if($mail->Send()) {} // https://code.google.com/a/apache-extras.org/p/phpmailer/source/browse/trunk/class.phpmailer.php |
Download it here : PHPMailer_5.2.4
Another Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<?php use PHPMailer\PHPMailer\PHPMailer; require 'vendor/autoload.php'; $mail = new PHPMailer; $mail->isSMTP(); $mail->SMTPDebug = 2; $mail->Host = 'smtp.kutayzorlu.com'; $mail->Port = 587; $mail->SMTPAuth = true; $mail->Username = 'box1@kutayzorlu.com'; $mail->Password = 'EMAIL_ACCOUNT_PASSWORD'; $mail->setFrom('box1@kutayzorlu.com', 'Your Name'); $mail->addReplyTo('2box@kutayzorlu.com', 'Your Name'); $mail->addAddress('kutayzorlu.com@gmail.com', 'Receiver Name'); $mail->Subject = 'PHPMailer SMTP message'; $mail->msgHTML(file_get_contents('message.html'), __DIR__); $mail->AltBody = 'This is a plain text message body'; $mail->addAttachment('testkutayzorlu.txt'); if (!$mail->send()) { echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message sent!'; } ?> |