Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /********************************************************************************************************************************
- File: sendmail.php
- Author: Burtscher Florian
- Date: 02.02.2017
- Description:
- This file contains the sendmail functions for mailing noreply messages to EmailClients.
- ***************************************************************************************************************************/
- require 'PHPMailer-master/PHPMailerAutoload.php';
- $result = sendmail('asdf','asdf','asdf','asdf');
- if(!$result){
- echo $result;
- }
- function sendmail($to,$subject,$message,$name){
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3;
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.world4you.com'; //'smtp1.example.com;smtp2.example.com'; // Specifay main and backup SMTP server
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'activation@scritex.com';
- $mail->Password = '*************';
- $mail->SMTPSecure = 'tls';
- $mail->Port = 587; // TCP port to connect
- $mail->setFrom('activation@scritex.com', 'Activation');
- $mail->addAddress('mytestmail1111@dkimvalidator.com', 'Florian Burtscher'); // Add a recipient
- $mail->addReplyTo('activation@scritex.com', 'Office'); // Add Reply To
- $mail->isHTML(true);
- $mail->Subject = 'Here is a Subject';
- $mail->Body = 'This is the HTML message body <b>in bold!</b>';
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- $mail->DKIM_domain = 'scritex.com';
- $mail->DKIM_private = '.htkeyprivate';
- $mail->DKIM_selector = 'dkim11';
- $mail->DKIM_passphrase = '1486107933';
- if(!$mail->send()){
- return $mail->ErrorInfo;
- }else{
- return true;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement