Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function __construct(){
- $dbCon = mysqli_connect("localhost", "root", "", "dbppa");
- }
- public function sendMail($e,$message,$subject){
- $mail = new PhpMailer;
- $body = $message;
- $subject = "PPA Newsletter";
- $clientName = $e;
- $mail->SMTPDebug = 2;
- $mail->CharSet = 'utf-8';
- $mail->isSMTP();
- $mail->SMTPAuth = true;
- $mail->Host = 'tls://smtp.gmail.com:587';
- $mail->Port = 587;
- $mail->Username = "myemail@mail.com";
- $mail->Password = "password";
- $mail->SMTPSecure = 'tls';
- $mail->setFrom("myemail@mail.com","PPA Administrator");
- $mail->addReplyTo('myemail@mail.com', 'PPA Admin');
- $mail->Subject = $subject;
- $mail->AltBody = "This is the official news letter from PPA ";
- $mail->Body = $body;
- $address = $e;
- $mail->AddAddress($address, $clientName);
- if(!$mail->Send()){
- echo "NOT SENT";
- }
- else{
- echo "SENT";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement