Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendMail($subject, $body, $to) {
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;
- $mail->SMTPAuth = true;
- $mail->Username = 'ted314089@gmail.com';
- $mail->Password = 'tilt314fry089';
- $mail->SMTPSecure = 'ssl';
- $mail->CharSet = 'UTF-8';
- $mail->SMTPDebug = true;
- $mail->From = "donotreply@trainbooking.com";
- $mail->FromName = "Train Booking";
- $mail->addAddress($to);
- $mail->WordWrap = 50;
- $mail->isHTML(true);
- $mail->Subject = $subject;
- $mail->Body = $body;
- if (!$mail->Send()) {
- throw new Exception($mail->ErrorInfo);
- }
- if(!$mail->send()) {
- return false;
- } else {
- return true;
- }
- }
- $to = $post->email;
- $subject = "Verify Account";
- $message = "
- Dear Customer,
- Thank you for taking the time to create an account in Train Booking. <br>
- You are now just one step away from creating your account.
- You can verify your account by clicking this link <br>
- ".root_url."/configuration.php?key=".$hash."&request=verify_account
- <br><br><br><br>
- <strong>NOTE:</strong> Do not respond to this email, it does not accept incoming emails!
- ";
- $retval = sendMail($subject, $message, $to);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement