Advertisement
Guest User

Untitled

a guest
May 25th, 2018
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <?php
  2. //connection file
  3. require_once "../dbconfig.php";
  4. $stmt = $db_con->prepare("SELECT * FROM tbl_sys");
  5. $stmt->execute();
  6. $sysRow = $stmt->fetch(PDO::FETCH_BOTH);
  7. $secure=$sysRow['secure'];
  8. $host=$sysRow['host'];
  9. $port=$sysRow['port'];
  10. $sys_email=$sysRow['sys_email'];
  11. $user_name=$sysRow['userName'];
  12. $password=$sysRow['password'];
  13. $sender=$sysRow['sender'];
  14. $replyTo=$sysRow['replyTo'];
  15. ?>
  16.  
  17. <?php
  18. class CV{
  19. function send_mail($sys_email,$message,$subject){
  20. require_once"../send_careers.php";
  21. require_once('mailer/class.phpmailer.php');
  22. require_once"query.php";
  23. $mail = new PHPMailer();
  24. $mail->IsSMTP();
  25. $mail->SMTPDebug = 1;
  26. $mail->SMTPAuth = true;
  27. $mail->SMTPSecure = $secure;
  28. $mail->Host = $host;
  29. $mail->Port = $port;
  30. $mail->AddAddress($sys_email);
  31. $mail->Username=$user_name;
  32. $mail->Password=$password;
  33. $mail->SetFrom($sender,'Prassi e Ricerca Onlus');
  34. $mail->AddReplyTo($replyTo,"Lia Bambagioni Prassi e Ricerca");
  35. $mail->Subject = $subject;
  36. $mail->MsgHTML($message);
  37. $mail->addAttachment($targetPath, $firstLast);
  38. $mail->Send();
  39. }
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement