Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2016-12-17 19:41:24 SMTP ERROR: Failed to connect to server: (0) 2016-12-17 19:41:24 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting error
- require_once 'PHPMailer-master/PHPMailerAutoload.php';
- $mail = new PHPMailer();
- $mail->IsSMTP();
- $mail->SMTPAuth = true;
- $mail->IsHTML(true);
- $mail->CharSet = "text/html; charset=UTF-8;";
- $mail->SMTPDebug = 2;
- $mail->SMTPSecure = 'ssl';
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 465;
- $mail->Username = "google email address";
- $mail->Password = "password";
- $mail->From = $email_from;
- $mail->FromName = "Name";
- $mail->AddAddress($to);
- $mail->Subject = $subject;
- $mail->Body = $message;
- $sent = $mail->Send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement