コード例 #1
0
 public function sendMail()
 {
     $mail = new Mail();
     $template = new Mailtemplate();
     $template->data['mail_from'] = "GMS Travels";
     $template->data['web_url'] = "http://www.gmstravels.com";
     $template->data['logo'] = "../public/images/logo.png";
     $template->data['company_name'] = "GMS Travels";
     $template->data['text_from'] = "GMS Travels";
     $template->data['text_greeting'] = "Dear Madam/Sir";
     // $_POST['subject'];
     $template->data['text_footer'] = "Thank you";
     $template->data['message'] = $_POST['message'];
     $mail->setTo($_POST['to_email']);
     $mail->setFrom("*****@*****.**");
     $mail->setSender("GMS Travels");
     $mail->setSubject(html_entity_decode(sprintf($_POST['subject']), ENT_QUOTES, 'UTF-8'));
     $mail->setHtml($template->gettmp('../views/tmp/emailtmp.tpl'));
     if ($mail->send()) {
         return true;
     } else {
         return false;
     }
 }
コード例 #2
0
 public function sendMail($name, $subject, $msg, $copy)
 {
     //$mail                                     = new Mail();
     $copy = implode(",", $copy);
     //$headers .= 'To: $email". "\r\n";
     $headers = 'X-Mailer: PHP/' . phpversion() . "\r\n";
     $headers .= 'MIME-Version: 1.0' . "\r\n";
     //$headers .= 'BCC: '. implode(",", $copy) . "\r\n";
     $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
     $headers .= 'From: ' . $name . " <" . ' info@robertjohnsonholdings.com' . ">\r\n";
     //print_r($headers);
     $template = new Mailtemplate();
     $template->data['mail_from'] = "Robert Johnson Holdings Nig. Ltd.";
     $template->data['web_url'] = "http://robertjohnsonholdings.com";
     $template->data['logo'] = "http://robertjohnsonholdings.com/control/public/img/logo.png";
     $template->data['company_name'] = "Robert Johnson Holdings Nig. Ltd.";
     $template->data['text_from'] = "Robert Johnson Holdings Nig. Ltd.";
     $template->data['text_greeting'] = "Dear " . $name;
     $template->data['text_footer'] = "Thank you";
     $template->data['text_message'] = "<b>Technical Support/Maintenance</b>";
     $template->data['message'] = $msg;
     //	print_r($copy);
     //	$mail->setTo("*****@*****.**");
     //  $mail->setCopy($copy);
     //	$mail->setFrom("*****@*****.**");
     //	$mail->setSender("Robert Johnson Holdings Nig. Ltd.");
     //	$mail->setSubject("Robert Johnson Holdings, Technical Support");
     //$mail->setText($msg);
     //$mail->setHtml($template->gettmp());
     mail($copy, $subject, $template->gettmp(), $headers);
     //$mail->send();
 }
コード例 #3
0
ファイル: login.php プロジェクト: runningjack/RobertJohnson
 public function sendMail($fname, $lname, $mname, $pass, $uname, $email)
 {
     $mail = new Mail();
     $template = new Mailtemplate();
     $template->data['mail_from'] = "Robert Johnson Holdings Nig. Ltd.";
     $template->data['web_url'] = "http://robertjohnsonholdings.com";
     $template->data['logo'] = "http://robertjohnsonholdings.com/public/img/logo.png";
     $template->data['company_name'] = "Robert Johnson Holdings Nig. Ltd.";
     $template->data['text_from'] = "Robert Johnson Holdings Nig. Ltd.";
     $template->data['text_greeting'] = "Dear {$fname} {$mname} " . strtoupper($lname);
     // $_POST['subject'];
     $template->data['text_footer'] = "Thank you";
     $template->data['text_message'] = "<b>Your login details</b>";
     $template->data['message'] = "<p>Robert Johnson Holdings password recovery console. Here is your login details are as follows</p>\n                        <ul style='list-style:none; list-style-image:none;'>\n                            <li><b>Username: </b>" . $uname . "</li>\n                            <li><b>Password: </b>" . $pass . "</li>\n                        </ul>\n                        <p>Please keep these as they will be required when you want to access your account portal on the Collo Network website</p>";
     $mail->setTo($email);
     $mail->setFrom("*****@*****.**");
     $mail->setSender("Robert Johnson Holdings Nig. Ltd.");
     $mail->setSubject("Robert Johnson Holdings password recovery");
     $mail->setHtml($template->gettmp('http://robertjohnsonholdings.com/emailtmp/email1.php'));
     if ($mail->send()) {
         return true;
     } else {
         return false;
     }
 }
コード例 #4
0
 /**
  * Enter description here...
  *
  * @param  unknown_type $template
  * @param  unknown_type $replaceData
  * @return unknown
  */
 function getMailMessage($template, $replaceData = array())
 {
     App::import('Model', 'Mailtemplate');
     $bcc = array();
     $search = array_keys($replaceData);
     $replace = array_values($replaceData);
     $objMailtemplate = new Mailtemplate();
     $objMailtemplate->unbindModel(array('belongsTo' => array('Language')));
     $tpl = $objMailtemplate->find(array('code' => $template, 'language_id' => $this->Session->read('User.Lang.id')), array('subject', 'from', 'body', 'bcc'), null, 0);
     //find
     unset($objMailtemplate);
     $tpl = $tpl['Mailtemplate'];
     if (empty($tpl)) {
         $this->logErr('Could not find email template: ' . $template);
         return false;
     } else {
         if (!empty($tpl['bcc'])) {
             $bcc = split(';', $tpl['bcc']);
         }
         return array('body' => str_replace($search, $replace, $tpl['body']), 'subject' => str_replace($search, $replace, $tpl['subject']), 'from' => $tpl['from'], 'bcc' => $bcc);
         //array
     }
 }
コード例 #5
0
 public function sendMail2($fname, $lname, $mname, $pass, $uname, $email)
 {
     $mail = new Mail();
     $template = new Mailtemplate();
     $template->data['mail_from'] = "Robert Johnson Holdings";
     $template->data['web_url'] = "http://robertjohnsonsupport.com";
     $template->data['logo'] = "http://robertjohnsonsupport.com/public/img/logo.png";
     $template->data['company_name'] = "Robert Johnson Holdings";
     $template->data['text_from'] = "Robert Johnson Holdings";
     $template->data['text_greeting'] = "Dear {$fname} {$mname} " . strtoupper($lname);
     // $_POST['subject'];
     $template->data['text_footer'] = "Thank you";
     $template->data['text_message'] = "<b>Your login details</b>";
     $template->data['message'] = "<p> Here is your login details are as follows, this will be required to login into your staff portal to access your account</p>\n                        <ul style='list-style:none; list-style-image:none;'>\n                            <li><b>Username: </b>" . $uname . "</li>\n                            <li><b>Password: </b>" . $pass . "</li>\n                        </ul>\n                        <p>Please keep these as they will be required when you want to access your account portal on the Chartered Marketers Auction Website </p>";
     $mail->setTo($email);
     $mail->setFrom("*****@*****.**");
     $mail->setSender("RobertJohnson Support.");
     $mail->setSubject("Robert Johnson Holdings Registration");
     $mail->setHtml($template->gettmp('http://robertjohnsonsupport.com/control/emailtmp/email1.tpl'));
     if ($mail->send()) {
         return true;
     } else {
         return false;
     }
 }