Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new PHPMailer(); // create a new object
- $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
- $mail->SMTPAuth = true; // authentication enabled
- $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
- $mail->Host = "XXX.XXX.XXX.XXX";
- $mail->Port = XXX; // or 587
- $mail->IsHTML(true);
- $mail->Username = "XXX@xyz.com";
- $subject = 'verfication email';
- $mail->Password = "XXXXXX";
- $mail->SetFrom('XXX@xyz.com');
- $mail->Subject = $subject;
- $user_login = $user->user_login;
- $user_id = $user->ID;
- $email = $user->user_email;
- $mail->addAddress($email);
- $mail->Body = 'Welome'.'<br>'.'Kindly Click On Below link to activate your account';
- if(!$mail->Send())
- {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- else
- {
- echo 'Thank you for registering ' . $user->user_login;
- echo '<br/>Kindly verify your email.'.$email;
- } // great Thanks to **Harneet Kaur**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement