Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailerPHPMailerPHPMailer;
- use PHPMailerPHPMailerException;
- require '../PHPMailer/src/SMTP.php';
- $mail = new PHPMailer;
- //Enable SMTP debugging.
- $mail->SMTPDebug = 2;
- //Set PHPMailer to use SMTP.
- $mail->isSMTP();
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- //Set SMTP host name
- $mail->Host = "smtp.gmail.com";
- //Set this to true if SMTP host requires authentication to send email
- $mail->SMTPAuth = true;
- //Provide username and password
- $mail->Username = "myusername@gmail.com";
- $mail->Password = "myemailpassword";
- //If SMTP requires TLS encryption then set it
- $mail->SMTPSecure = "tls";
- //Set TCP port to connect to
- $mail->Port = 587;
- $mail->From = "myemail";
- $mail->FromName = "myname";
- $mail->addAddress($email);
- $mail->isHTML(true);
- $mail->CharSet = 'UTF-8';
- $mail->Subject = "ACTIVATE YOUR ACCOUNT";
- $search = array('[sponsor]', '[email]', '[uid]', '[code]', '[username]', '[phone]', '[password]', '[bankname]', '[accname]', '[accno]');
- $replace = array($sponsor, $email, $uid, $code, $username, $phone, $_POST['password'], $bankname, $accname, $accno);
- $mail->Body = str_replace($search, $replace, file_get_contents('../Emails/registeremail.html'));
- if(!$mail->send())
- {
- //add support link later
- $_SESSION['sign_msg']= "Something Went Wrong, Please contact Support";
- header('location:signup.php');
- }
- else
- {
- $_SESSION['sign_msg'] = "Verification link has been sent to your email. ☑ <br>
- Click on the link to verify your account";
- header('location:signup.php');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement