Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. <?php
  2. /********************************************************************************************************************************
  3. File: sendmail.php
  4. Author: Burtscher Florian
  5. Date: 02.02.2017
  6. Description:
  7. This file contains the sendmail functions for mailing noreply messages to EmailClients.
  8. ***************************************************************************************************************************/
  9.  
  10. require 'PHPMailer-master/PHPMailerAutoload.php';
  11.  
  12.  
  13. $result = sendmail('asdf','asdf','asdf','asdf');
  14.  
  15. if(!$result){
  16. echo $result;
  17. }
  18.  
  19.  
  20. function sendmail($to,$subject,$message,$name){
  21. $mail = new PHPMailer;
  22.  
  23. //$mail->SMTPDebug = 3;
  24.  
  25. $mail->isSMTP(); // Set mailer to use SMTP
  26. $mail->Host = 'smtp.world4you.com'; //'smtp1.example.com;smtp2.example.com'; // Specifay main and backup SMTP server
  27. $mail->SMTPAuth = true; // Enable SMTP authentication
  28. $mail->Username = 'activation@scritex.com';
  29. $mail->Password = '*************';
  30. $mail->SMTPSecure = 'tls';
  31. $mail->Port = 587; // TCP port to connect
  32.  
  33. $mail->setFrom('activation@scritex.com', 'Activation');
  34. $mail->addAddress('mytestmail1111@dkimvalidator.com', 'Florian Burtscher'); // Add a recipient
  35. $mail->addReplyTo('activation@scritex.com', 'Office'); // Add Reply To
  36.  
  37. $mail->isHTML(true);
  38.  
  39. $mail->Subject = 'Here is a Subject';
  40. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  41. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  42.  
  43. $mail->DKIM_domain = 'scritex.com';
  44. $mail->DKIM_private = '.htkeyprivate';
  45. $mail->DKIM_selector = 'dkim11';
  46. $mail->DKIM_passphrase = '1486107933';
  47.  
  48. if(!$mail->send()){
  49. return $mail->ErrorInfo;
  50. }else{
  51. return true;
  52. }
  53. }
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement