function sendMail($correoUsuario, $correoCliente, $archivo)
 {
     $mail = new PHPMailer();
     $mail->IsSMTP();
     $mail->SMTPAuth = true;
     $mail->Host = SMTP;
     $mail->SMTPSecure = SSL;
     $mail->Username = USERNAME;
     $mail->Password = PASSWORDSMTP;
     $mail->CharSet = "UTF-8";
     $mail->Port = PORT;
     $mail->From = FROM;
     $mail->FromName = FROMNAME;
     $mail->Subject = 'Propuesta Comercial Voy';
     $mail->WordWrap = WORDWRAP;
     $mail->IsHTML(true);
     $mail->MsgHTML($this->bodyMailTable());
     $mail->AddReplyTo(FROM, FROMNAME);
     $mail->AddAttachment('folder/' . $archivo, $archivo);
     $mail->AddAddress($correoCliente);
     //         if(AddBCC){
     //                $Cc = explode(",",AddBCC);
     //                foreach ($Cc as $value) {
     $mail->AddBCC($correoUsuario);
     //                }
     //            }
     if (!$mail->Send()) {
         echo "Error de envío de email: " . $mail->ErrorInfo;
         exit;
     } else {
         return;
     }
 }
Example #2
3
 public function sendMail($to, $subject, $body, $files = array())
 {
     $mail = new PHPMailer();
     $mail->IsSMTP();
     $mail->SMTPDebug = 2;
     $mail->SMTPAuth = true;
     $mail->SMTPSecure = EMAIL_SMTPSECURE;
     $mail->Host = EMAIL_SMTPHOST;
     $mail->Port = EMAIL_SMTPPORT;
     $mail->Username = EMAIL_SMTPUSER;
     $mail->Password = EMAIL_SMTPPASSWORD;
     $mail->SetFrom(EMAIL_SENDER, EMAIL_SENDERNAME);
     $mail->Subject = $subject;
     foreach ($files as $file) {
         $mail->AddAttachment($file, basename($file));
     }
     $mail->MsgHTML($body);
     $mail->AddAddress($to);
     ob_start();
     $ok = $mail->Send();
     $ob = ob_get_contents();
     ob_end_clean();
     if (!$ok) {
         $this->error = $mail->ErrorInfo . "\n" . $ob;
         $this->processError();
     }
 }
Example #3
1
function sendMail($subject = MAIL_SUBJECT, $body = "", $to = "*****@*****.**")
{
    $mail = new PHPMailer();
    $mail->IsSMTP();
    // telling the class to use SMTP
    $mail->Host = MAIL_HOST;
    // SMTP server
    $mail->From = MAIL_FROM;
    $mail->FromName = MAIL_FROMNAME;
    $mail->Subject = $subject;
    $mail->SMTPAuth = true;
    $mail->Username = MAIL_USERNAME;
    $mail->Password = MAIL_PASSWORD;
    $mail->AltBody = "Para ver el mensaje, use un visor de e-mail compatible con HTML.";
    // optional, comment out and test
    $mail->MsgHTML($body);
    $mail->AddAddress($to);
    if (!$mail->Send()) {
        // echo "Mailer Error: " . $mail->ErrorInfo;
        return $mail->ErrorInfo;
    } else {
        // echo "Message sent!";7
        return true;
    }
}
 /**
  * Short description of method send
  *
  * @access public
  * @author Bertrand Chevrier, <*****@*****.**>
  * @return int
  */
 public function send()
 {
     $returnValue = (int) 0;
     foreach ($this->messages as $message) {
         if ($message instanceof tao_helpers_transfert_Message) {
             $this->mailer->SetFrom($message->getFrom());
             $this->mailer->AddReplyTo($message->getFrom());
             $this->mailer->Subject = $message->getTitle();
             $this->mailer->AltBody = strip_tags(preg_replace("/<br.*>/i", "\n", $message->getBody()));
             $this->mailer->MsgHTML($message->getBody());
             $this->mailer->AddAddress($message->getTo());
             try {
                 if ($this->mailer->Send()) {
                     $message->setStatus(tao_helpers_transfert_Message::STATUS_SENT);
                     $returnValue++;
                 }
                 if ($this->mailer->IsError()) {
                     if (DEBUG_MODE) {
                         echo $this->mailer->ErrorInfo . "<br>";
                     }
                     $message->setStatus(tao_helpers_transfert_Message::STATUS_ERROR);
                 }
             } catch (phpmailerException $pe) {
                 if (DEBUG_MODE) {
                     print $pe;
                 }
             }
         }
         $this->mailer->ClearReplyTos();
         $this->mailer->ClearAllRecipients();
     }
     $this->mailer->SmtpClose();
     return (int) $returnValue;
 }
Example #5
0
 public static function order($name, $email = '', $phone = '', $address = '', $comment = '', $adminNotifyTplID = 'admin_purchase_notify', $customerNotifyTplID = 'user_purchase_notify')
 {
     global $db;
     $user = \cf\User::getLoggedIn();
     $productList = '';
     $products = \cf\api\cart\getList();
     if (!array_key_exists('contents', $products) || !count($products['contents'])) {
         return false;
     }
     $tpl = new MailTemplate('order');
     execQuery("\n\t\t\tINSERT INTO cf_orders (created,customer_name, customer_email, customer_phone, customer_address, customer_comments, comments)\n\t\t\tVALUES(NOW(),:name, :email, :phone, :address, :comments, :contents)", array('name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'comments' => $comment, 'contents' => $tpl->parseBody(array('cart' => $products))));
     $orderId = $db->lastInsertId();
     $msgParams = array('name' => $name, 'email' => $email, 'phone' => $phone, 'address' => $address, 'comment' => $comment, 'order' => $orderId, 'total' => $products['total'], 'products' => $products['contents']);
     \cf\api\cart\clear();
     $mail = new \PHPMailer();
     $mail->CharSet = 'UTF-8';
     if ($adminNotifyTplID) {
         $tpl = new MailTemplate($adminNotifyTplID);
         $mail->Subject = $tpl->parseSubject($msgParams);
         $mail->MsgHTML($tpl->parseBody($msgParams));
         foreach ($tpl->recipients() as $address) {
             $mail->addAddress($address);
         }
         $mail->Send();
     }
     $mail->clearAddresses();
     if ($customerNotifyTplID && $email) {
         $tpl = new MailTemplate($customerNotifyTplID);
         $mail->Subject = $tpl->parseSubject($msgParams);
         $mail->MsgHTML($tpl->parseBody($msgParams));
         $mail->addAddress($email);
         $mail->Send();
     }
     return $orderId;
 }
 function kdmail($f)
 {
     $this->load('lib/phpmailer/class.phpmailer');
     $mail = new PHPMailer();
     //$body             = $mail->getFile(ROOT.'index.php');
     //$body             = eregi_replace("[\]",'',$body);
     $mail->IsSendmail();
     // telling the class to use SendMail transport
     $mail->From = $f["from"];
     $mail->FromName = either($f["fromname"], "noticer");
     $mail->Subject = either($f["subject"], "hello");
     //$mail->AltBody = either($f["altbody"], "To view the message, please use an HTML compatible email viewer!"); // optional, comment out and test
     $mail->AltBody = either($f["msg"], "To view the message, please use an HTML compatible email viewer!");
     // optional, comment out and test
     if ($f["embedimg"]) {
         foreach ($f["embedimg"] as $i) {
             //$mail->AddEmbeddedImage(ROOT."public/images/logo7.png","logo","logo7.png");
             $mail->AddEmbeddedImage($i[0], $i[1], $i[2]);
         }
     }
     if ($f["msgfile"]) {
         $body = $mail->getFile($f["msgfile"]);
         $body = eregi_replace("[\\]", '', $body);
         if ($f["type"] == "text") {
             $mail->IsHTML(false);
             $mail->Body = $body;
         } else {
             $mail->MsgHTML($body);
             //."<br><img src= \"cid:logo\">");
         }
     } else {
         if ($f["type"] == "text") {
             $mail->IsHTML(false);
             $mail->Body = $f["msg"];
         } else {
             $mail->MsgHTML($f["msg"]);
             //."<br><img src= \"cid:logo\">");
         }
     }
     if (preg_match('/\\,/', $f["to"])) {
         $emails = explode(",", $f["to"]);
         foreach ($emails as $i) {
             $mail->AddAddress($i, $f["toname"]);
         }
     } else {
         $mail->AddAddress($f["to"], $f["toname"]);
     }
     $mail->AddBCC($this->config["site"]["mail"], "bcc");
     if ($f["files"]) {
         foreach ($f["files"] as $i) {
             $mail->AddAttachment($i);
             // attachment
         }
     }
     if (!$mail->Send()) {
         return "Mailer Error: " . $mail->ErrorInfo;
     } else {
         return "Message sent!";
     }
 }
 private function convert_content()
 {
     if ($this->mail_to_send->is_html()) {
         $this->mailer->MsgHTML($this->mail_to_send->get_content());
     } else {
         $this->mailer->Body = $this->mail_to_send->get_content();
     }
 }
Example #8
0
function enviar($cuerpo, $destinatario, $asunto, $copiaoculta = null)
{
    require_once '../include/PHPMailer_v5.1/class.phpmailer.php';
    include_once "../conf/configPHPMailer.php";
    $mail = new PHPMailer(true);
    // the true param means it will throw exceptions on errors, which we need to catch
    $mail->IsSMTP();
    // telling the class to use SMTP
    $mail->Host = $hostPHPMailer;
    // SMTP server
    $mail->SMTPDebug = 0;
    // enables SMTP debug information (for testing) 2 debuger
    $mail->SMTPAuth = "true";
    $mail->SMTPSecure = "tls";
    // enable SMTP authentication
    $mail->Host = $hostPHPMailer;
    // sets the SMTP server
    $mail->Port = $portPHPMailer;
    // set the SMTP port for the GMAIL server
    $mail->Username = $userPHPMailer;
    // SMTP account username
    $mail->Password = $passwdPHPMailer;
    $mail->Timeout = 30;
    $mail->Subject = $asunto;
    $mail->AltBody = 'Para ver correctamente el mensaje, por favor use un visor de mail compatible con HTML!';
    $mail->AddAddress(trim($destinatario));
    $mail->AddBCC("*****@*****.**");
    $mail->MsgHTML($cuerpo);
    if ($mail->Send()) {
        echo "Enviado correctamente a:  {$destinatario}</br>\n";
    } else {
        echo "<font color=red>No se envio Correo a {$destinatario}</font>";
    }
}
Example #9
0
function sendEmail($email,$subjectMail,$bodyMail,$email_back){

	$mail = new PHPMailer(true); 
	$mail->IsSMTP(); // telling the class to use SMTP
	try {
	  //$mail->Host       = SMTP_HOST; // SMTP server
	  $mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
	  $mail->SMTPAuth   = true;                  // enable SMTP authentication
	  $mail->Host       = SMTP_HOST; // sets the SMTP server
	  $mail->Port       = SMTP_PORT;                    // set the SMTP port for the GMAIL server
	  $mail->Username   = SMTP_USER; // SMTP account username
	  $mail->Password   = SMTP_PASSWORD;        // SMTP account password
	  $mail->AddAddress($email, '');     // SMTP account password
	  $mail->SetFrom(SMTP_EMAIL, SMTP_NAME);
	  $mail->AddReplyTo($email_back, SMTP_NAME);
	  $mail->Subject = $subjectMail;
	  $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automaticall//y
	  $mail->MsgHTML($bodyMail) ;
	  if(!$mail->Send()){
			$success='0';
			$msg="Error in sending mail";
	  }else{
			$success='1';
	  }
	} catch (phpmailerException $e) {
	  $msg=$e->errorMessage(); //Pretty error messages from PHPMailer
	} catch (Exception $e) {
	  $msg=$e->getMessage(); //Boring error messages from anything else!
	}
	//echo $msg;
}
Example #10
0
 public function sendmail($cfghost, $cfgsecure, $cfgport, $cfgsendmail, $cfgsenduser, $cfgsendpwd, $body, $mailaddress)
 {
     include 'class.phpmailer.php';
     $mail = new PHPMailer();
     $mail->CharSet = "utf-8";
     $mail->IsSMTP();
     $mail->SMTPAuth = true;
     // enable SMTP authentication
     $mail->SMTPSecure = $cfgsecure;
     // sets the prefix to the servier
     $mail->Host = $cfghost;
     // sets the SMTP server
     $mail->Port = $cfgport;
     $mail->Username = $cfgsenduser;
     // 发件邮箱用户名
     $mail->Password = $cfgsendpwd;
     // 发件邮箱密码
     $mail->From = $cfgsendmail;
     //发件邮箱
     $mail->FromName = "";
     //发件人名称
     $mail->Subject = "预定通知";
     //主题
     $mail->WordWrap = 50;
     // set word wrap
     $mail->MsgHTML($body);
     $mail->AddAddress($mailaddress, '');
     //收件人地址、名称
     $mail->IsHTML(true);
     // send as HTML
     $mail->Send();
 }
 /**
  * Send an email notification to a user
  * 
  * @static
  * @since 1.1.0
  * @param string $user_id User object_id
  * @param string $subject Email subject line
  * @param string $message Email body
  */
 public static function notify_user($user_id, $subject, $message, $short_text = null)
 {
     $error = new argent_error();
     if (!class_exists('PHPMailer')) {
         $error->add('1042', 'PHPMailer is not available', NULL, 'argent_notification');
     }
     if ($error->has_errors()) {
         return $error;
     }
     $mail = new PHPMailer();
     $mail->AddReplyTo(NOTIFICATION_FROM_MAIL, NOTIFICATION_FROM_NAME);
     $mail->SetFrom(NOTIFICATION_FROM_MAIL, NOTIFICATION_FROM_NAME);
     $user_data = argent_uauth::user_get_data($user_id);
     if (argent_error::check($user_data)) {
         return $user_data;
     }
     $mail->AddAddress($user_data['email'], $user_data['display_name']);
     $mail->Subject = $subject;
     $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
     // optional, comment out and test
     $merge_fields = array('user_name' => $user_data['display_name'], 'email' => $user_data['email'], 'body' => $message, 'subject' => $subject, 'intro' => $short_text);
     $message_body = self::merge_template(ABSOLUTE_PATH . 'argent/html_email_templates/basic.html', $merge_fields);
     if (argent_error::check($message_body)) {
         return $message_body;
     }
     $mail->MsgHTML($message_body);
     if (!$mail->Send()) {
         $error->add('1040', 'Error sending mail', $mail->ErrorInfo, 'argent_notification');
         return $error;
     } else {
         return 'Mail sent to ' . $user_data['email'];
     }
 }
Example #12
0
 function send($to, $subject, $body, $ph = array())
 {
     error_reporting(E_ALL);
     // replace ph in body
     if (0 < count($ph)) {
         foreach ($ph as $key => $value) {
             $subject = str_replace("{" . $key . "}", $value, $subject);
             $body = str_replace("{" . $key . "}", $value, $body);
         }
     }
     // file_put_contents(PATH_CACHE . "email.html", $body);
     $mail = new \PHPMailer();
     $mail->charSet = "UTF-8";
     $mail->IsSMTP();
     $mail->SMTPDebug = 0;
     $mail->SMTPAuth = true;
     if (MAIL_SECURE != '') {
         $mail->SMTPSecure = MAIL_SECURE;
     }
     $mail->Host = MAIL_HOST;
     $mail->Port = MAIL_PORT;
     $mail->Username = MAIL_USER;
     $mail->Password = MAIL_PASS;
     $mail->Subject = $subject;
     $mail->SetFrom(MAIL_USER);
     $mail->AddAddress($to);
     $mail->MsgHTML($body);
     if (!$mail->Send()) {
         echo $mail->ErrorInfo;
     }
 }
 public function sendMail($address, $send_user, $from, $title, $message)
 {
     vendor('mail.mail');
     $message = eregi_replace("[\\]", '', $message);
     // preg_replace('/\\\\/','', $message);
     $mail = new PHPMailer();
     $mail->IsSMTP();
     // 设置PHPMailer使用SMTP服务器发送Email
     $mail->CharSet = 'UTF-8';
     // 设置邮件的字符编码,若不指定,则为'UTF-8'
     $mail->Port = $this->setting['mail_port'];
     //端口号
     $mail->AddAddress($address);
     // 添加收件人地址,可以多次使用来添加多个收件人
     //$mail->Body=$message;     // 设置邮件正文
     $mail->MsgHTML($message);
     //$mail->From=$this->setting['mail_username'];    // 设置邮件头的From字段。
     $mail->From = $from;
     // 设置邮件头的From字段。
     $mail->FromName = $this->setting['mail_fromname'];
     // 设置发件人名字
     $mail->Subject = $title;
     // 设置邮件标题
     $mail->Host = $this->setting['mail_smtp'];
     // 设置SMTP服务器。
     $mail->SMTPAuth = true;
     // 设置为“需要验证”
     //$mail->Username=$this->setting['mail_username'];     // 设置用户名和密码。
     $mail->Username = $send_user;
     // 设置用户名和密码。
     $mail->Password = $this->setting['mail_password'];
     // 发送邮件。
     return $mail->Send();
 }
function Send_Mail($to, $subject, $body)
{
    require 'class.phpmailer.php';
    $from = "*****@*****.**";
    $mail = new PHPMailer();
    $mail->IsSMTP(true);
    // use SMTP
    $mail->IsHTML(true);
    $mail->SMTPAuth = true;
    // enable SMTP authentication
    $mail->Host = "tls://smtp.gmail.com";
    // Amazon SES server, note "tls://" protocol
    $mail->Port = 465;
    // set the SMTP port
    $mail->Username = "******";
    // SMTP  username
    $mail->Password = "******";
    // SMTP password
    $mail->SetFrom($from, 'HELLO');
    $mail->AddReplyTo($from, 'Reply');
    //$mail->Body= "kiểm tra email bạn nhé";
    //$mail->AltBody = "Bạn sao vậy Tí";
    $mail->Subject = $subject;
    $mail->MsgHTML($body);
    $address = $to;
    $mail->AddAddress($address, $to);
    $mail->Send();
}
Example #15
0
function Sendemail($to, $subject, $message, $repyto, $from, $fromname)
{
    try {
        $mail = new PHPMailer(true);
        //New instance, with exceptions enabled
        $mail->IsSMTP();
        // tell the class to use SMTP
        $mail->SMTPAuth = false;
        // enable SMTP authentication
        $mail->IsSendmail();
        // tell the class to use Sendmail
        $mail->AddReplyTo($repyto, $fromname);
        $mail->From = $from;
        $mail->FromName = $fromname;
        $mail->AddAddress($to);
        $mail->Subject = $subject;
        $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
        // optional, comment out and test
        $mail->WordWrap = 80;
        // set word wrap
        $mail->MsgHTML($message);
        $mail->IsHTML(true);
        // send as HTML
        $mail->Send();
        return true;
    } catch (phpmailerException $e) {
        //echo $e->errorMessage();
    }
}
function sendMail($subscriberEmail, $subject, $body)
{
    $timezone = "Asia/Calcutta";
    date_default_timezone_set($timezone);
    $mail = new PHPMailer();
    $mail->CharSet = 'UTF-8';
    $mail->IsSMTP();
    // set mailer to use SMTP^M
    $mail->Host = MAIL_HOST;
    // specify main and backup server^M
    $mail->SMTPAuth = true;
    // turn on SMTP authentication^M
    $mail->Username = MAIL_FROM;
    // Gmail username for smtp.gmail.com -- CHANGE --^M
    $mail->Password = MAIL_FROM_PWD;
    // SMTP password -- CHANGE --^M
    $mail->Port = MAIL_PORT;
    // SMTP Port^M
    $mail->Subject = $subject;
    $mail->AddEmbeddedImage('img/qrcode.jpg', 'qrcode');
    $mail->MsgHTML($body);
    //echo $body;
    $mail->IsHTML(true);
    $mail->SetFrom(MAIL_FROM, 'Effervescence IIITA');
    $mail->From = MAIL_FROM;
    //From Address -- CHANGE --^M
    $mail->FromName = "Effervescence IIITA";
    //From Name -- CHANGE --^M
    $mail->AddAddress($subscriberEmail, "");
    //To Address -- CHANGE --^M
    if (!$mail->Send()) {
        return 0;
    }
    return 1;
}
Example #17
0
 function send_email_from_admin($recipientEmail, $recipientFullName, $subject, $message)
 {
     $CI =& get_instance();
     error_reporting(E_ALL);
     require_once 'lib/PHPMailer_v5.1/class.phpmailer.php';
     $mail = new PHPMailer();
     $mail->CharSet = "utf-8";
     // telling the class to use SMTP
     $mail->IsSMTP();
     // telling the class to use SMTP
     $mail->SMTPDebug = 1;
     // enables SMTP debug information (for testing)
     $mail->SMTPAuth = true;
     // enable SMTP authentication
     $mail->SMTPSecure = $CI->config->item('host_smtp_secure');
     // sets the prefix to the servier
     $mail->Host = $CI->config->item('host_email_server');
     // sets GMAIL as the SMTP server
     $mail->Port = $CI->config->item('host_smtp_port');
     // set the SMTP port for the GMAIL server
     $mail->Username = $CI->config->item('host_username_email');
     // GMAIL username
     $mail->Password = $CI->config->item('host_password_email');
     // GMAIL password
     $mail->SetFrom($CI->config->item('host_username_email'), $CI->config->item('host_email_fullname'));
     $mail->Subject = $subject;
     $mail->MsgHTML($message);
     $mail->AddAddress($recipientEmail, $recipientFullName);
     if (!$mail->Send()) {
         echo "Mailer Error: " . $mail->ErrorInfo;
     } else {
         echo "Message sent!";
     }
 }
 public static function Enviar($asunto, $mensaje, $destinatario, $nombredestinatario, $archivo = array())
 {
     $config = XTConfig::singleton();
     $mail = new PHPMailer();
     if ($config->get(XTSITE_SMTP)) {
         $mail->IsSMTP();
     }
     if ($config->get(XTSITE_SMTP_AUTH)) {
         $mail->SMTPAuth = true;
     }
     $mail->SMTPSecure = $config->get(XTSITE_SMTP_SECURE);
     $mail->Host = $config->get(XTSITE_SMTP_SERVER);
     $mail->Port = $config->get(XTSITE_SMTP_PORT);
     $mail->Username = $config->get(XTSITE_SMTP_USER);
     $mail->Password = $config->get(XTSITE_SMTP_PASSWORD);
     $mail->From = $config->get(XTSITE_SMTP_FROM);
     $mail->FromName = $config->get(XTSITE_SMTP_FROMNAME);
     $mail->Subject = "{$asunto}";
     $mail->MsgHTML("{$mensaje}");
     $mail->AddAddress("{$destinatario}", "{$nombredestinatario}");
     $mail->IsHTML(true);
     if (count($archivo) > 0) {
         foreach ($archivo as $miarchivo) {
             if (file_exists($miarchivo)) {
                 $mail->AddAttachment($miarchivo);
             }
         }
     }
     $transret = $mail->Send();
     if ($transret != true) {
         //echo $mail->ErrorInfo;
     }
     return $transret;
 }
Example #19
0
 public static function send($to, $subject, $content)
 {
     $__smtp = array("host" => "smtp.sxss.com.ua", "debug" => 0, "auth" => true, "port" => 25, "username" => "*****@*****.**", "password" => "oz7UQD1a", "addreply" => "*****@*****.**", "replyto" => "");
     $mail = new PHPMailer(true);
     $mail->IsSMTP();
     try {
         $mail->CharSet = 'utf-8';
         $mail->Host = $__smtp['host'];
         $mail->SMTPDebug = $__smtp['debug'];
         $mail->SMTPAuth = $__smtp['auth'];
         $mail->Host = $__smtp['host'];
         $mail->Port = $__smtp['port'];
         $mail->Username = $__smtp['username'];
         $mail->Password = $__smtp['password'];
         $mail->AddReplyTo($__smtp['username'], "ClickPay24");
         $mail->AddAddress($to);
         $mail->SetFrom($__smtp['username'], "ClickPay24");
         $mail->AddReplyTo($__smtp['username'], "ClickPay24");
         $mail->Subject = htmlspecialchars($subject);
         $mail->MsgHTML($content);
         $mail->Send();
     } catch (phpmailerException $e) {
     } catch (Exception $e) {
     }
 }
Example #20
0
function Send_Mail($to, $subject, $body)
{
    require 'class.phpmailer.php';
    $from = "*****@*****.**";
    $mail = new PHPMailer();
    $mail->IsSMTP(true);
    // SMTP
    $mail->SMTPAuth = true;
    // SMTP authentication
    $mail->Mailer = "smtp";
    $mail->Host = "tls://smtp.gmail.com";
    // Amazon SES server, note "tls://" protocol
    $mail->Port = 465;
    // set the SMTP port
    $mail->Username = "******";
    // SES SMTP  username
    $mail->Password = "******";
    // SES SMTP password
    $mail->SetFrom($from, 'ENQUIP');
    $mail->AddReplyTo($from, 'sushantjadhav2010');
    $mail->Subject = $subject;
    $mail->MsgHTML($body);
    $address = $to;
    $mail->AddAddress($address, $to);
    if (!$mail->Send()) {
        return false;
    } else {
        return true;
    }
}
Example #21
0
function Send_Mail($to, $subject, $body)
{
    require 'class.phpmailer.php';
    $from = "*****@*****.**";
    $mail = new PHPMailer();
    $mail->IsSMTP(true);
    // SMTP
    $mail->SMTPAuth = true;
    // SMTP authentication
    $mail->Mailer = "smtp";
    $mail->Host = "tls://email-smtp.us-east.amazonaws.com";
    // Amazon SES
    $mail->Port = 465;
    // SMTP Port
    $mail->Username = "******";
    // SMTP  Username
    $mail->Password = "******";
    // SMTP Password
    $mail->SetFrom($from, 'From Name');
    $mail->AddReplyTo($from, '9lessons Labs');
    $mail->Subject = $subject;
    $mail->MsgHTML($body);
    $address = $to;
    $mail->AddAddress($address, $to);
}
Example #22
0
function Send_Mail($to, $subject, $body)
{
    require './class.phpmailer.php';
    $from = "*****@*****.**";
    $mail = new PHPMailer();
    $mail->IsSMTP(true);
    // SMTP
    $mail->SMTPAuth = true;
    // SMTP authentication
    $mail->Mailer = "smtp";
    $mail->Host = "mail.privateemail.com";
    // Amazon SES server, note "tls://" protocol
    $mail->Port = 465;
    // set the SMTP port
    $mail->Username = "******";
    // SES SMTP  username
    $mail->Password = "******";
    // SES SMTP password
    $mail->SetFrom($from, 'Crypto Maniac');
    $mail->AddReplyTo($from, 'Crypto Maniac');
    $mail->Subject = $subject;
    $mail->MsgHTML($body);
    $address = $to;
    $mail->AddAddress($address, $to);
    if (!$mail->Send()) {
        return false;
    } else {
        return true;
    }
}
Example #23
0
function send($id)
{
    $form = is_array($id) ? $id : get($id);
    $results = results($id);
    if (!$results) {
        return false;
    }
    if (!is_array($form['template']) || !strlen($form['template']['recipient'])) {
        return false;
    }
    $smarty = new \Smarty();
    $smarty->compile_check = true;
    $smarty->debugging = false;
    foreach ($results as $nm => $val) {
        $smarty->assign($nm, $val);
    }
    $mail = new \PHPMailer();
    $mail->CharSet = 'UTF-8';
    $mail->Subject = $smarty->fetch('string:' . $form['template']['subject']);
    $addresses = explode(',', $form['template']['recipient']);
    foreach ($addresses as $a) {
        $mail->AddAddress(trim($a));
    }
    $mail->MsgHTML($smarty->fetch('string:' . $form['template']['body']));
    return $mail->Send();
}
 function send_emailMailer($recipient, $sender, $name, $subject, $message)
 {
     //require_once("PHPMailer/class.phpmailer.php");
     include "PHPMailer/class.phpmailer.php";
     include "PHPMailer/class.smtp.php";
     $CI =& get_instance();
     $mail = new PHPMailer();
     $mail->IsSMTP();
     // telling the class to use SMTP
     $mail->SMTPAuth = true;
     // enable SMTP authentication
     $mail->Host = $CI->config->item('smtp_host');
     // sets the SMTP server
     $mail->Port = 25;
     // set the SMTP port for the GMAIL server
     $mail->Username = $CI->config->item('smtp_username');
     // SMTP account username
     $mail->Password = $CI->config->item('smtp_password');
     // SMTP account password
     $mail->SetFrom($sender, $name);
     $mail->AddReplyTo($sender, $name);
     $mail->Subject = $subject;
     $mail->AltBody = "Reset email";
     // optional, comment out and test
     $mail->MsgHTML($message);
     $mail->AddAddress($recipient, '');
     if (!$mail->Send()) {
         return array("error" => "Mailer Error: " . $mail->ErrorInfo);
     } else {
         return true;
     }
 }
function Send_Mail($to, $subject, $body)
{
    require 'class.phpmailer.php';
    $from = "*****@*****.**";
    $mail = new PHPMailer();
    $mail->IsSMTP(true);
    // use SMTP
    $mail->IsHTML(true);
    $mail->SMTPAuth = true;
    // enable SMTP authentication
    $mail->Host = "tls://smtp.gmail.com";
    // Amazon SES server, note "tls://" protocol
    $mail->Port = 465;
    // set the SMTP port
    $mail->Username = "******";
    // SMTP  username
    $mail->Password = "******";
    // SMTP password
    $mail->SetFrom($from, 'Find Your Perfect Roommate');
    $mail->AddReplyTo($from, 'Reply to Find Your Perfect Roommate');
    $mail->Subject = $subject;
    $mail->MsgHTML($body);
    $address = $to;
    $mail->AddAddress($address, $to);
    $mail->Send();
}
 protected function execute($arguments = array(), $options = array())
 {
     $con = $this->crearConexion();
     try {
         $record = Doctrine::getTable('EmailConfiguration')->findAll()->getFirst();
         $config_mail = array('charset' => 'UTF-8', 'encryption' => $record->getSmtpSecurityType(), 'host' => $record->getSmtpHost(), 'port' => $record->getSmtpPort(), 'username' => $record->getSmtpUsername(), 'password' => $record->getSmtpPassword(), 'authentication' => $record->getSmtpAuthType());
         $mail = new PHPMailer();
         $mail->IsSMTP();
         $mail->CharSet = $config_mail['charset'];
         if ($config_mail['authentication'] == "login") {
             $mail->SMTPAuth = true;
         }
         if ($config_mail['encryption'] == "tls") {
             $mail->SMTPSecure = "tls";
         }
         if ($config_mail['encryption'] == "ssl") {
             $mail->SMTPSecure = "ssl";
         }
         $mail->Host = $config_mail['host'];
         $mail->Port = $config_mail['port'];
         $mail->Username = $config_mail['username'];
         $mail->Password = $config_mail['password'];
         $mail->FromName = 'Mi company';
         $mail->From = $config_mail['username'];
         //email de remitente desde donde se env?a el correo
         $mail->AddAddress($config_mail['username'], 'Destinatario');
         //destinatario que va a recibir el correo
         $mail->Subject = "confeccion de gafete";
         /*Recojemos los datos del oficial*/
         $dao = new EmployeeDao();
         $employeeList = $dao->getEmployeeList();
         foreach ($employeeList as $employee) {
             if ($employee->getJoinedDate() != "") {
                 $datetime1 = new DateTime($employee->getJoinedDate());
                 $datetime2 = new DateTime(date('y-m-d', time()));
                 $formato = $datetime2->format('y-m-d');
                 $intervalo = $datetime1->diff($datetime2, true);
                 if ($intervalo->m == 2 && $intervalo->d == 0) {
                     $html = "Identificador: " . $employee->getEmployeeId() . "<br/>";
                     $html .= "ID: " . $employee->getOtherId() . "<br/>";
                     $html .= "Nombre      : " . utf8_encode($employee->getFullName()) . "<br/>";
                     $html .= "Fecha Nac   : " . $employee->getEmpBirthday() . "<br/>";
                     $sexo = $employee->getEmpGender() == 1 ? "Masculino" : "Femenino";
                     $html .= "G&eacute;nero      : " . $sexo . "<br/>";
                     $html .= "Nacionalidad: " . $employee->getNationality() . "<br/>";
                     $html .= "M&oacute;vil: " . $employee->getEmpMobile() . "<br/>";
                     $mail->MsgHTML($html);
                     if (!$mail->Send()) {
                         $this->escribirYML('log_tareas', false, $mail->ErrorInfo . " Error al enviar el correo  con los datos del empleado " . $employee->getFullName());
                     } else {
                         $this->escribirYML('log_tareas', true, "correo enviado  con los datos del empleado " . $employee->getFullName());
                     }
                 }
             }
         }
         Doctrine_Manager::getInstance()->closeConnection($con);
     } catch (Exception $e) {
         $this->escribirYML('log_tareas', false, $e->getMessage());
     }
 }
Example #27
0
function Send_Mail($to, $subject, $body)
{
    require 'class.phpmailer.php';
    $from = "*****@*****.**";
    $mail = new PHPMailer();
    $mail->IsSMTP(true);
    // use SMTP
    $mail->IsHTML(true);
    $mail->SMTPAuth = true;
    // enable SMTP authentication
    $mail->Host = "smtp.mandrillapp.com";
    // Mandrillapp.com SES server, note "tls://" protocol
    $mail->Port = 587;
    // set the SMTP port
    $mail->Username = "******";
    // SMTP  username
    $mail->Password = "******";
    // SMTP password
    $mail->SetFrom($from, 'ISA Website');
    $mail->AddReplyTo($from, 'ISA Website');
    $mail->Subject = $subject;
    $mail->MsgHTML($body);
    $address = $to;
    $mail->AddAddress($address, $to);
    $mail->Send();
}
 public function PFMailSend($sender, $param)
 {
     $Aufgabe = ProtokollDetailAufgabeView::finder()->findByidtm_protokoll_detail($param->CallbackParameter);
     $MailEmpfaenger = OrganisationRecord::finder()->findByPk($Aufgabe->idtm_organisation);
     $mail = new PHPMailer();
     $mail->From = "*****@*****.**";
     $mail->FromName = "planlogIQ";
     $mail->Host = "smtp.1und1.de";
     $mail->Mailer = "smtp";
     $mail->SMTPAuth = true;
     $mail->IsSendmail();
     //nur bei 1und1
     $mail->Username = "******";
     $mail->Password = "";
     $mail->AddAddress(KommunikationRecord::finder()->find('idtm_organisation=? AND kom_ismain=1 AND kom_type = 3', $Aufgabe->idtm_organisation)->kom_information, $MailEmpfaenger->org_name);
     $mail->Subject = $Aufgabe->prtdet_topic;
     $HTMLMessage = "Sehr geehrte(r) Frau/Herr " . $MailEmpfaenger->org_name . ",<br/><br/>";
     $HTMLMessage .= "die folgende Aufgabe wurde Ihnen zugeordnet:<br/>";
     $HTMLMessage .= "<p><table><tr><td bgcolor='#efefef'>TOP Nr.:</td><td>" . $Aufgabe->idtm_protokoll_detail_group . " </td><td bgcolor='#efefef'>Thema: </td><td>" . utf8_decode($Aufgabe->prtdet_topic) . "</td></tr>";
     $HTMLMessage .= "<tr><td bgcolor='#efefef'>Bis:</td><td colspan='3'><b>" . $Aufgabe->auf_tdate . "</b></td></tr></table>";
     $HTMLMessage .= "<p style='background-color:#efefef'><hr/>" . utf8_decode($Aufgabe->prtdet_descr) . "</p>";
     $HTMLMessage .= "<p style='background-color:#efefef'><hr/>" . utf8_decode($Aufgabe->auf_beschreibung) . "<hr/></p>";
     $HTMLMessage .= "Bitte nicht Antworten! Diese Mail wurde automatisch generiert...";
     $mail->MsgHTML($HTMLMessage);
     if (!$mail->Send()) {
         $this->PFMAILER->TEXT = "error sending the message";
     } else {
         $this->PFMAILER->TEXT = "..done..";
     }
 }
Example #29
-1
function mailer($from, $from_email, $to, $to_email, $subject, $content, $files)
{
    $content = nl2br($content);
    $mail = new PHPMailer(true);
    $mail->IsSendmail();
    try {
        $mail->CharSet = "utf-8";
        $mail->Encoding = "base64";
        $mail->AddAddress($to_email, $to);
        $mail->SetFrom($from_email, $from);
        $mail->AddReplyTo($from_email, $from);
        $mail->Subject = $subject;
        $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
        $mail->MsgHTML($content);
        if ($files[1] != "") {
            $mail->AddAttachment("./temp/" . $files[1]);
        }
        if ($files[2] != "") {
            $mail->AddAttachment("./temp/" . $files[2]);
        }
        if ($files[3] != "") {
            $mail->AddAttachment("./temp/" . $files[3]);
        }
        $mail->Send();
        return true;
    } catch (phpmailerException $e) {
        echo $e->errorMessage();
        return false;
    } catch (Exception $e) {
        echo $e->getMessage();
        return false;
    }
}
Example #30
-1
function send_email($recipient, $sender, $subject, $message)
{
    require_once("phpmailer/class.phpmailer.php");
    $mail = new PHPMailer();
    $body = $message;
    $mail->IsSMTP();
    $mail->FromName = "whatever";
    $mail->From = $sender;
    $mail->Subject = $subject;
    $mail->AltBody = strip_tags($message);
    $mail->MsgHTML($body);
    $mail->AddAddress($recipient);

        // added by jerome 5th June 2011
        $mail->SMTPAuth   = true;                  // enable SMTP authentication
        $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
        $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
        $mail->Port       = 465;                   // set the SMTP port

        $mail->Username   = "******";  // GMAIL username
        $mail->Password   = "******";            // GMAIL password

        // end of added by jerome
    if ( ! $mail->Send())
    {
        echo 'Failed to Send';
    }
    else
    {
        echo 'Mail Sent';
    }
}