daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Sep 25th, 2016 1,492 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static function sendTestEmail(){
  2.         $mail = new PHPMailer;
  3.         //$mail->SMTPDebug = 3;                               // Enable verbose debug output
  4.         $mail->isSMTP();                                      // Set mailer to use SMTP
  5.         $mail->SMTPOptions = array(
  6.             'ssl' => array(
  7.                 'verify_peer' => false,
  8.                 'verify_peer_name' => false,
  9.                 'allow_self_signed' => true
  10.             )
  11.         );
  12.         $mail->SMTPAuth = true;                               // Enable SMTP authentication
  13.         //$mail->SMTPDebug=2;
  14.  
  15.         $mail->Host = 'mail.pgpriorcargo.com';  // Specify main and backup SMTP servers
  16.         $mail->Username = 'webmaster@pgpriorcargo.com';                 // SMTP username
  17.         $mail->Password = '1q2w3e4r5t';                           // SMTP password
  18.         //$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
  19.         $mail->Port = 587;                                    // TCP port to connect to
  20.         $mail->setFrom('webmaster@pgpriorcargo.com', 'PGPriorCargo Webmaster');
  21.         $mail->AddReplyTo('webmaster@pgpriorcargo.com', 'PGPriorCargo Webmaster');
  22.         $mail->Subject = 'Priorcargo pending materials';
  23.         $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!";
  24.         $mail->isHTML(true);
  25.         /*$headers = "MIME-Version: 1.0" . "\r\n";
  26.         $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
  27.         $headers .= "From: webmaster@pgpriorcargo.com" . "\r\n" .
  28.             "Reply-To: webmaster@pgpriorcargo.com" . "\r\n" .
  29.             "X-Mailer: PHP/" . phpversion();
  30.         $mail->addCustomHeader($headers);*/
  31.         $template=file_get_contents(Config::PATH."/views/emailtemplates/test.html");
  32.         //$mail->addAddress("swamyveera@gmail.com", "Veeru PV");
  33.         //barracuda@barracuda.emailtests.com, mr@mr.emailtests.com, previews_98@gmx.de, litmuscheck05@gmail.com, email.tests@aol.com,
  34.         // litmuscheck03@yahoo.com, litmuscheck04@mail.com, litmuscheck04@outlook.com, litmuscheck04@emailtests.onmicrosoft.com,
  35.         // previews_98@web.de, litmuscheck02@mail.ru, litmuscheck10@gmail.com, litmuscheck01@gapps.emailtests.com,
  36.         // litmuscheck03@ms.emailtests.com, litmustestprod05@gd-testing.com, litmustestprod01@yandex.com,
  37.         // 87de77b660@s.litmustest.com, 87de77b660@sg3.emailtests.com, 87de77b660@ml.emailtests.com
  38.         $mail->addAddress("barracuda@barracuda.emailtests.com", "Veeru PV");
  39.         $mail->addAddress("mr@mr.emailtests.com", "Veeru PV");
  40.         $mail->addAddress("previews_98@gmx.de", "Veeru PV");
  41.         $mail->addAddress("litmuscheck05@gmail.com", "Veeru PV");
  42.         $mail->addAddress("email.tests@aol.com", "Veeru PV");
  43.         $mail->addAddress("email.tests@aol.com", "Veeru PV");
  44.         $mail->MsgHTML($template);
  45.         //$mail->Body=$template;
  46.         $response=array();
  47.         if(!$mail->send()){
  48.             $response["status"]=0;
  49.             $response["message"]="Error sending email";
  50.         }else{
  51.             $response["status"]=1;
  52.             $response["message"]="Email sent";
  53.  
  54.         }
  55.         echo json_encode($response);
  56.        
  57.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand