Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Import PHPMailer classes into the global namespace
- // These must be at the top of your script, not inside a function
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- require 'PHPMailer/src/Exception.php';
- require 'PHPMailer/src/PHPMailer.php';
- require 'PHPMailer/src/SMTP.php';
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
- //Server settings
- $mail->SMTPDebug = 2; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'icom'; // SMTP username
- $mail->Password = 'S8'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- //Recipients
- $mail->setFrom('inforus1968@gmail.com', 'Rus Gold');
- $mail->addAddress($email, 'RUS GOLD USER'); // Add a recipient
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'RUS GOLD Reset Password';
- $mail->Body = " <h2 style='font-family: arial'>Hello, We are from RUS GOLD</h2>
- <p style='font-family: arial'>We just recived a Request saying You Forgot your password. Don't Worry you can Change your password by Clicking below Link</p>
- <a href=".$url."><button style='background-color:#5E0000;color:white;padding:14px 20px;margin:8px 0;border:0;cursor:pointer;width:20%;opacity:.9;'>Choose a new Password</button></a>
- <p style='font-family: arial'>If you don't have any idea about this, then you can ingore this E-mail. your RUS GOLD password will not change.</p>";
- $mail->AltBody = " <h2 style='font-family: arial'>Hello, We are from RUS GOLD</h2>
- <p style='font-family: arial'>We just recived a Request saying You Forgot your password. Don't Worry you can Change your password by Clicking below Link</p>
- <a href=".$url."><button style='background-color:#5E0000;color:white;padding:14px 20px;margin:8px 0;border:0;cursor:pointer;width:20%;opacity:.9;'>Choose a new Password</button></a>
- <p style='font-family: arial'>If you don't have any idea about this, then you can ingore this E-mail. your RUS GOLD password will not change.</p>";
- $mail->send();
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error';//, //$mail->ErrorInfo
- }
- ?>
Add Comment
Please, Sign In to add comment