Beispiel #1
0
 /**
  *发送邮件
  *
  *@param   string  发送邮箱地址
  *@param   array   接收邮箱地址
  *@param   array   抄送人
  *@param   string  邮件标题
  *@param   string  邮件内容
  *@param   array   文件附件,地址格式
  *@param   string  编码格式
  */
 public function send($from, $to, $cc = '', $subject, $content = '', $files = '', $char = 'utf-8')
 {
     $site_email = new htmlMimeMail5();
     $site_email->setHeadCharset($char);
     $site_email->setTextCharset($char);
     $site_email->setHtmlCharset($char);
     $site_email->setFrom($from);
     $site_email->setSubject($subject);
     $site_email->setHTML($content);
     $site_email->setCc($cc);
     $address = explode(",", $to);
     if ($files != '') {
         foreach ($files as $file) {
             if (file_exists($file)) {
                 $attachment = new fileAttachment($file);
                 $site_email->addAttachment($attachment);
             } else {
                 $this->logger->write_log('ERROR', 'MAIL: attachment ' . $file . ' not exists');
             }
         }
     }
     foreach ($address as $k) {
         $mail[$k] = 1;
     }
     foreach ($mail as $k => $v) {
         $address_new[] = $k;
     }
     if ($site_email->send($address_new)) {
         return true;
     } else {
         return false;
     }
 }
Beispiel #2
0
function send_mail_client($email)
{
    $text = '<p>Спасибо за регистрацию!</p>';
    $text .= '<p>Ждем Вас  24 и 25 марта 2015 года в НСК «Олимпийский»,"Зал Чемпионов".</p>';
    $mailSend = new htmlMimeMail5();
    $helo = "Aviaforum Kiev";
    $mailSend->setFrom('Aviaforum Kiev <' . MAILUSER . '>');
    $mailSend->setTextCharset('utf-8');
    $mailSend->setHtmlCharset('utf-8');
    $mailSend->setHeadCharset('utf-8');
    $mailSend->setSubject('Авиафорум');
    $mailSend->setHTML($text);
    $mailSend->send(array($email), mail);
}
Beispiel #3
0
 * Set high priority for the email. This can also be:
 * high/normal/low/1/3/5
 */
$mail->setPriority('high');
/**
 * Set the text of the Email
 */
$mail->setText('Sample text');
/**
 * Set the HTML of the email. Any embedded images will be automatically found as long as you have added them
 * using addEmbeddedImage() as below.
 */
$mail->setHTML('<p><b>Dear Recipient</b>,</p>
        
        <br>
          <a href="http://www.emmgts.com/export/export_cafehits.php?w=1&DB_TBLName=cafe_hits">Download Report</a>
          
        </p>
<p><img src="background.gif" width="1024" height="6" /><img src="4.jpg" width="137" height="40" /></p> ');
/**
 * Set the delivery receipt of the email. This should be an email address that the receipt should be sent to.
 * You are NOT guaranteed to receive this receipt - it is dependent on the receiver.
 */
$mail->setReceipt('*****@*****.**');
/**
 * Add an embedded image. The path is the file path to the image.
 */
$mail->addEmbeddedImage(new fileEmbeddedImage('background.gif'));
$mail->addEmbeddedImage(new fileEmbeddedImage('4.jpg'));
/**
 * Add an attachment to the email.
Beispiel #4
0
 function send_report_mail($recipient)
 {
     global $PATH, $MAIL_CFG, $LNK;
     $fullfilename = $this->fname;
     $msg = "Ein Backup vom Server zum Backup-Server wurde erstellt. Dabei wurde folgendes Protokoll erstellt:\n\n";
     $msg .= $fullfilename . "\n\n";
     $msg .= "Es gab folgende FEHLER (nur solche, die automatisch erfasst werden konnten):\n\n";
     $sql = "select * from reports where klasse like 'ERROR' order by uid asc;";
     $result = mysqli_query($LNK, $sql);
     $txt = "";
     while ($row = mysqli_fetch_assoc($result)) {
         $txt .= $row["datum"] . "\t";
         $txt .= $row["meldung"] . "\n";
     }
     $msg .= $txt;
     if ($txt == "") {
         $msg .= "< KEINE. >";
     }
     $msg .= "\n\n\nEs gab folgende WARNUNGEN:\n\n";
     $sql = "select * from reports where klasse like 'WARNING' order by uid asc;";
     $result = mysqli_query($LNK, $sql);
     $txt = "";
     while ($row = mysqli_fetch_assoc($result)) {
         $txt .= $row["datum"] . "\t";
         $txt .= $row["meldung"] . "\n";
     }
     $msg .= $txt;
     if ($txt == "") {
         $msg .= "< KEINE. >";
     }
     $mail = new htmlMimeMail5();
     $mail->setFrom($MAIL_CFG["from"]);
     $mail->setSubject('Backup-Durchlauf ' . strftime('%d.%m.%y %H:%M:%S', time()));
     $mail->setHeader('Date', date('D, d M y H:i:s O'));
     $mail->setTextCharset('UTF-8');
     $mail->setText($msg);
     $mail->setHtmlCharset('UTF-8');
     $mail->setHTML(file_get_contents($this->fname));
     // $mail->addEmbeddedImage(new fileEmbeddedImage($PATH."img/APPrototype.gif"));
     // $mail->addAttachment(new fileAttachment('example.zip'));
     $mail->setSMTPParams($MAIL_CFG["host"], $MAIL_CFG["port"], $MAIL_CFG["helo"], $MAIL_CFG["auth"], $MAIL_CFG["user"], $MAIL_CFG["pass"]);
     $mail->send(array($recipient), 'smtp');
     // first param is an array!
     if (isset($mail->errors)) {
         echo "\n\n\nFehler beim Versand der Report-Mail an {$recipient} !\n\n\n";
         if (is_array($mail->errors)) {
             echo implode("; ", $mail->errors) . "\n";
             // non-fatal;
         } else {
             errlog($mail->errors) . "\n";
             // non-fatal;
         }
     }
 }
Beispiel #5
0
//$mail->setText('Sample text');
/**
 * Set the HTML of the email. Any embedded images will be automatically found as long as you have added them
 * using addEmbeddedImage() as below.
 */
$mail->setHTML('<div style="width:550px; height:550px;">
  <div style="width:522px;padding-top:22px; margin:auto">
    <Div><img src="http://www.emmgts.com/images/logo.gif" alt="" width="139" height="49" /> </Div>
    <Div style="width:522px; height:1px; background:#333333"><img src="images/spacer.gif" alt="" height="1"/></Div>
    <div style="padding:45px 20px 20px 20px; height:380px;background:#f1f1f1; font-family:Arial, Helvetica, sans-serif; font-size:11px; line-height:18px; color:#000000">Dear Cyber Café Owner,<br />
      <br />
      You can now check your payment status regularly by visiting the following URL: <font style="text-decoration:none; color:#005aff"><a href="http://cafe.emmgts.com" target="_blank">http://cafe.emmgts.com</a></font> using your café ID and the password: <strong>welcome</strong> <br />
      <br />
      You can also access your payment details by logging in from our website: <font style="text-decoration:none; color:#005aff"><a href="http://cafe.emmgts.com">http://www.envisagemedia.in</a></font> by clicking on the "Associates" login tab.<br />
      <br />
      From now onwards, you will get your payment either by online transfer or by demand draft between 1st to 5th of every month. Our tele-executive will call you shortly so please help us by providing the required information. <br />
      <br />
      Also, please update your contact details with our tele-caller so we can keep you updated.<br />
      <br />
      Warm Regards,
      Team –<strong> Envisage Media Pvt. Ltd</strong> <br />
      Office Phone: 011-46027732 <br />
      Mobile: +91-9582111906 <br/>
      90/27A Malviya Nagar,<br />
      New Delhi - 110017 </div>
  </div>
');
/**
 * Set the delivery receipt of the email. This should be an email address that the receipt should be sent to.
 * You are NOT guaranteed to receive this receipt - it is dependent on the receiver.
 */
$mail->setReceipt('*****@*****.**');
function sendMailToCafe($cafe_user_id, $password, $email)
{
    require_once '../classes/mail/htmlMimeMail5.php';
    $mail = new htmlMimeMail5();
    $mail->setFrom('Envisage Media Pvt. Ltd. <*****@*****.**>');
    $mail->setSubject('Cafe Registration Confirmation');
    $mail->setPriority('high');
    $mail->setText('Cafe Registration');
    $html_msg = '<div style="width:550px; float:left; background:#f1f1f1">
  <div style="padding:10px;">
    <Div style="background:#FFFFFF; padding:15px">
      <div style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; line-height:16px; text-decoration:none"><img src="http://www.emmgts.com/images/logo.gif" alt="" width="151" height="46" /><br />
          <br />
        <br />
        Dear Cyber Caf&ecirc; Owner,<br />
<br />

A warm welcome to the Envisage Media Family.<br />
<br />
<br>
          Your Cafe has been activated </br>
		  
		  Your cafe id is :' . $cafe_user_id . '
		  </br>
		  Your Password : '******'
          
        </p>
It is our pleasure to be associated with you. With your cooperation we look forward to both of us reaching great level of success. We can assure you this will be mutually beneficial collaboration.<br />
<br />
You can check your payment status regularly by visiting the following 
URL:<br>
<a href="http://cafe.emmgts.com" target="_blank" style="text-decoration:none"> http://cafe.emmgts.com</a> using your caf&ecirc; ID: ' . $cafe_user_id . ' and the password: '******'
<br />
<br />
You can also access your payment details by logging in from our website: <br />
<a href="http://www.envisagemedia.in" target="_blank" style="text-decoration:none">http://www.envisagemedia.in</a> by clicking on the "Associates" login tab.
<br />
<br />
From now onwards, you will get your payment either by online transfer or by demand draft between the 1st and 10th of every month. Our tele-executive will call you shortly so please help us by providing the required information. 
<br />
      <br />
      <br />
      <strong>Payment Terms and Conditions </strong>
<ol style="margin-left:35px;margin-right:5px; padding:0px; margin-top:10px"><li>Money will keep getting added on a daily basis</li>
<li>You will get a fixed daily amount. (Monthly amount divide by the number of days)</li>
<li>Your systems should be live for a minimum of 4 hours to get the days payment.</li>
<li>Live means there should be use of your system for a minimum of 4 hours a day or you can say minimum 4 users use your system.</li>
<li>Your payment cycle will shift on 1st of next month</li></ol><br />
<strong>Installation process</strong><br />
<br />

<font color="#FF0000"><strong>Step 1:</strong></font> Download setup file using following URL www.envisagemedia.in/EMDesktop.msi 
Or download the product from our website <a href="http://www.envisagemedia.in" target="_blank" style="text-decoration:none">www.envisagemedia.in</a> (Product page)
<br />
<br />
<font color="#FF0000"><strong>Step 2: </strong></font>Run the setup file while double clicking on it.
<br />
<br />
<font color="#FF0000"><strong>Step 3:</strong></font> Fill your caf&ecirc; ID which will when the installation is in progress. As shown below:
<br />
<br />
<img src="http://www.emmgts.com/images/img1.jpg" alt="" width="448" height="371" /><br />
<br />
As the installation process will end.<br />
<br />
<font color="#FF0000"><strong>Step 4:</strong></font> Log off your PC once and then login.<br />
<br />
You will find EMDesktop will be running on your desktop screen
Also, please update your contact details with our tele-caller so we can keep you updated.
<br />
<br />
<br />
Warm Regards,<br /> 
Team - <strong><font color="#3277d9"> Envisage Media Pvt. Ltd</font><br />
</strong>
Office Phone: 011-46027732 
<br />
Mobile: +91-9582111906<br /> 
90/27A Malviya Nagar,
New Delhi - 110017
<br />

</div>
    </Div>
  </div>
</div>

<p><img src="http://www.emmgts.com/classes/mail/background.gif" width="1024" height="6" /><img src="http://www.emmgts.com/classes/mail/4.jpg" width="137" height="40" /></p> ';
    $mail->setHTML($html_msg);
    $mail->setReceipt('*****@*****.**');
    $mail->addEmbeddedImage(new fileEmbeddedImage('../classes/mail/background.gif'));
    $mail->addEmbeddedImage(new fileEmbeddedImage('../classes/mail/4.jpg'));
    $mail_envi = '*****@*****.**';
    $result = $mail->send(array($email, $mail_envi, '*****@*****.**', '*****@*****.**'));
    return $result;
}
Beispiel #7
0
 * Set the text of the Email
 */
// $mail->setText('Sample text');
/**
 * Set the HTML of the email. Any embedded images will be automatically found as long as you have added them
 * using addEmbeddedImage() as below.
 */
$date = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
$htmlMailTemplate = '<p><b>Dear Recipient</b>,</p>
        
        <br>
          <a href="http://www.emmgts.com/export/export_cafehits.php?w=1&amp;date=' . $date . '">Download Report</a>
          
        </p>
<p><img src="/home/emmgts/public_html/mail/background.gif" width="1024" height="6" /><img src="4.jpg" width="137" height="40" /></p> ';
$mail->setHTML($htmlMailTemplate);
/**
 * Set the delivery receipt of the email. This should be an email address that the receipt should be sent to.
 * You are NOT guaranteed to receive this receipt - it is dependent on the receiver.
 */
$mail->setReceipt('*****@*****.**');
/**
 * Add an embedded image. The path is the file path to the image.
 */
$mail->addEmbeddedImage(new fileEmbeddedImage('/home/emmgts/public_html/mail/background.gif'));
$mail->addEmbeddedImage(new fileEmbeddedImage('/home/emmgts/public_html/mail/4.jpg'));
/**
 * Add an attachment to the email.
 */
//$mail->addAttachment(new fileAttachment(''));
/**
 /**
  * Envoie de mail sur l'evolution des données de la transactions depuis Arcadia
  * @param string $paramSujet
  * @param string $paramCorpMail
  * @param string $paramArdTto
  * @param string $paramArdFrom
  * @param string $paramUrlSmtp
  * @return string
  */
 function sendMail($paramSujet, $paramCorpMail, $paramArdTto, $paramArdFrom, $paramUrlSmtp)
 {
     //Création du mail
     $mail = new htmlMimeMail5();
     //
     $mail->setSMTPParams($paramUrlSmtp);
     // Set the From and Reply-To headers
     $mail->setFrom($paramArdFrom);
     $mail->setReturnPath($paramArdFrom);
     // Set the Subject
     $mail->setSubject($paramSujet);
     /**
      * Encodement en utf-8
      */
     $mail->setTextCharset("UTF-8");
     $mail->setHTMLCharset("UTF-8");
     $mail->setHeadCharset("UTF-8");
     // Set the body
     $mail->setHTML(nl2br($paramCorpMail));
     /**
      * L'envoi réel du mail n'est pas réalisé en environnement Codeur
      */
     $result = $mail->send(array($paramArdTto), 'smtp');
     return $result;
 }
/**
 * Set the text of the Email
 */
$mail->setText('Daily report of no of screen installed');
/*
 * sending date parameter
 */
$date = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
/**
 * Set the HTML of the email. Any embedded images will be automatically found as long as you have added them
 * using addEmbeddedImage() as below.
 */
//$fb = fopen('http://www.emmgts.com/export/mail_daily_installation.php','r');
$mail->setHTML('     
        <p><b>Dear Recipient</b>,</p>
                   <a href="http://www.emmgts.com/export/mail_daily_installation.php?date=' . $date . '">View Details</a>
                      <p></p>
                      
                      ');
/**
 * Set the delivery receipt of the email. This should be an email address that the receipt should be sent to.
 * You are NOT guaranteed to receive this receipt - it is dependent on the receiver.
 */
$mail->setReceipt('*****@*****.**');
/**
 * Add an embedded image. The path is the file path to the image.
 */
/**
 * Add an attachment to the email.
 */
//$mail->addAttachment(new fileAttachment(''));
/**
 public function sendMail($strSubject, $strHtmlBody, $strSender, $arrRecipients)
 {
     $strReturn = "";
     //*** Build the e-mail.
     $strTextBody = str_replace("<br /> ", "<br />", $strHtmlBody);
     $strTextBody = str_replace("<br />", "\n", $strTextBody);
     $strTextBody = str_replace("&nbsp;", "", $strTextBody);
     $strTextBody = strip_tags($strTextBody);
     $strTextBody = html_entity_decode($strTextBody, ENT_COMPAT, "UTF-8");
     //*** Send the email.
     $objMail = new htmlMimeMail5();
     $objMail->setHTMLEncoding(new Base64Encoding());
     $objMail->setTextCharset("utf-8");
     $objMail->setHTMLCharset("utf-8");
     $objMail->setHeadCharset("utf-8");
     $objMail->setFrom($strSender);
     $objMail->setSubject($strSubject);
     $objMail->setText($strTextBody);
     $objMail->setHTML($strHtmlBody);
     if (!$objMail->send($arrRecipients)) {
         $strReturn = $objMail->errors;
     }
     return $strReturn;
 }
function envoismail($sujetmail, $text, $destinataire, $expediteur, $paramTypeMail = null, $conf = null)
{
    if ($conf == null) {
        $globalConfig = new GlobalConfig();
    }
    if ($globalConfig->getConf()->getSmtpServiceEnable() == TRUE) {
        /*
         * Toutes les adresses emails sont redirigées vers utilisateurs.fta@ldc.fr
         * Si la redirection est mis en place
         */
        if ($globalConfig->getConf()->getSmtpEmailRedirectionUser()) {
            $destinataire_orig = $destinataire;
            $destinataire = $globalConfig->getConf()->getSmtpEmailRedirectionUser();
            $sujetmail_orig = $sujetmail;
            $sujetmail = "[Environnement " . $globalConfig->getConf()->getExecEnvironment() . "] " . $sujetmail_orig;
            $text_orig = $text;
            if (is_array($destinataire_orig)) {
                $listeDesDestinataire = explode(",", $destinataire_orig);
            } else {
                $listeDesDestinataire = $destinataire_orig;
            }
            $text = $listeDesDestinataire . "\n" . $text_orig;
        }
        //Création du mail
        $mail = new htmlMimeMail5();
        $mail->setSMTPParams($globalConfig->getConf()->getSmtpServerName());
        // Set the From and Reply-To headers
        $mail->setFrom($expediteur);
        $mail->setReturnPath($expediteur);
        // Set the Subject
        $mail->setSubject($sujetmail);
        /**
         * Encodement en utf-8
         */
        $mail->setTextCharset("UTF-8");
        $mail->setHTMLCharset("UTF-8");
        $mail->setHeadCharset("UTF-8");
        // Set the body
        $mail->setHTML(nl2br($text));
        //$result = $mail->send(array($adresse_to), 'smtp');
        //$result = $mail->send(array($destinataire), 'smtp');
        /**
         * L'envoi réel du mail n'est pas réalisé en environnement Codeur
         */
        if ($paramTypeMail != "mail-transactions") {
            $result = $mail->send(array($destinataire), 'smtp');
        }
        if (!$result and $globalConfig->getConf()->getExecEnvironment() == EnvironmentConf::ENV_PRD) {
            $paramTypeMail = "Erreur";
        }
    }
    /**
     * Génération de log
     */
    $paramLog = $paramTypeMail . " " . $expediteur . " " . $destinataire . "\n" . $sujetmail . "\n" . $text;
    //    Logger::AddMail($paramLog, $paramTypeMail);
}
Beispiel #12
0
 public function sendMsgNow($message)
 {
     $mType = $message->mType;
     $recp = westorElggMan_get_entity($message->toId);
     $sender = westorElggMan_get_entity($message->fromId);
     $senderEmail = $this->getEntityProperty($sender, elgg_echo('ElggMan_:cEmail'));
     $subject = $message->title;
     $body = $message->description;
     if ($message->mType == "EMAIL" || $message->mType == "EMAILTXT") {
         $mail = new htmlMimeMail5();
     }
     switch ($message->mType) {
         case "EMAIL":
             $mail->setHTMLCharset("UTF-8");
             $mail->setHTML($body);
         case "EMAILTXT":
             $mail->setTextCharset("UTF-8");
             $mail->setHeadCharset("UTF-8");
             $mail->setFrom($senderEmail);
             $mail->setSubject($subject);
             $search = array("|<br[[:space:]]*/?[[:space:]]*>|i", "|</p>|i");
             $replace = array("\r\n", "\r\n");
             $mail->setText(strip_tags(html_entity_decode(preg_replace($search, $replace, $body))));
             if ($recp->getSubtype() == "PrivateContact") {
                 $mail->send(array($recp->user_email));
             } else {
                 $mail->send(array($recp->email));
             }
             $message->waitForSend = 0;
             // mark as done
             $message->state = 'OK';
             break;
         case "HQ-SMS":
             $senderNumber = $sender->westorElggManSMSSender;
             $recipientNumber = $this->getEntityProperty($recp, elgg_echo('ElggMan_:cMobile'));
             $result = $this->sendSMSToGateway($senderNumber, $recipientNumber, $body, $message->mType);
             if ($result["success"]) {
                 $message->waitForSend = 0;
                 // mark as done
                 $message->state = 'OK';
             } else {
                 if ($message->retryed >= 3) {
                     $message->waitForSend = 0;
                     // mark as done
                     $message->state = 'FAILED';
                 }
                 $message->retryed++;
             }
             break;
         default:
     }
     // switch
     $message->save();
     return $result;
 }