Esempio n. 1
0
 function sendPaymentReminder()
 {
     $subject = 'Vehicle Payment Reminder with' . WEB_FULL_NAME;
     $message = "Dear " . $this->admin->getFullName() . ",<br /><br />\n\n        You are using our premium services from {$this->vehicle->getVehicleDepolyDate()} .<br />\n\n        Vehicle was Added Under Company : {$this->company->getName()}<br /><br />\n\n        Vehicle was Added By : {$addedby->getFullName()}<br /><br />\n\n        Vehicle Details :<br /><br />\n        Vehicle Type : {$this->vehicle->getType()} <br />\n        Vehicle Model : {$this->vehicle->getModel()} <br />\n        Make Year: {$this->vehicle->getMakeYear()} <br /><br />\n        Vehicle Number: {$this->vehicle->getVehicleNumber()} <br /><br />\n        Description: {$this->vehicle->getType()} <br /><br />\n        Adding Date : {$this->vehicle->getDateAdded()} <br /><br />\n\n        Vehicle Activate Date : {$this->vehicle->getVehicleDepolyDate()} <br /><br />\n\n        Premium Service Start Date : {$this->vehicle->getVehicleDepolyDate()} <br /><br />\n\n        Premium Service End Date : {$this->vehicle->getVehicleDepolyDate()} <br /><br />\n\n        Payment Done Till Today :{$this->vehicle->getVehicleDepolyDate()} <br /><br />\n\n        Expected Payment Amount :{$this->vehicle->getVehicleDepolyDate()} <br /><br />\n\n        ";
     $message = Mailer::makeMessage($message);
     return Mailer::SendMail($this->admin->getEmail(), $subject, $message);
 }
Esempio n. 2
0
 public static function SendMessagebyPHP($puserid, $subject, $message)
 {
     $msgToUser = "";
     $msg = "Dear " . $puserid;
     $msg .= "<br /><br />";
     $message = $msg . $message;
     $message = Mailer::makeMessage($message);
     $message .= Mailer::addMessageFooter($puserid);
     return Mailer::SendMail($puserid, $subject, $message);
 }
Esempio n. 3
0
function mail_subscribe($city, $team, $partner, $subscribe)
{
    global $INI;
    $week = array('日', '一', '二', '三', '四', '五', '六');
    $today = date('Y年n月j日 星期') . $week[date('w')];
    $vars = array('today' => $today, 'team' => $team, 'city' => $city, 'subscribe' => $subscribe, 'partner' => $partner, 'help_email' => $INI['subscribe']['helpemail'], 'help_mobile' => $INI['subscribe']['helpphone'], 'notice_email' => $INI['mail']['reply']);
    $message = render('mail_subscribe_team', $vars);
    $options = array('contentType' => 'text/html', 'encoding' => 'UTF-8');
    $from = $INI['mail']['from'];
    $to = $subscribe['email'];
    $subject = $INI['system']['sitename'] . "今日团购:{$team['title']}";
    if ($INI['mail']['mail'] == 'mail') {
        Mailer::SendMail($from, $to, $subject, $message, $options);
    } else {
        Mailer::SmtpMail($from, $to, $subject, $message, $options);
    }
}
Esempio n. 4
0
 public function GenerateNewPassword()
 {
     $connector = new Connector();
     $newPassword = $this->GeneratePassword();
     $sql = "";
     $sql .= " UPDATE members_info";
     $sql .= "\tSET password = '******'";
     $sql .= " WHERE";
     $sql .= " \temail = '" . $this->currentEmail . "'";
     $mysqliQuery = mysqli_query($connector->GetConnection(), $sql);
     if ($mysqliQuery) {
         $mailer = new Mailer();
         $mailer->SetRecepient($this->currentEmail);
         $mailer->EmailNewPassword($newPassword);
         $mailer->SendMail();
         return true;
     } else {
         return false;
     }
 }
Esempio n. 5
0
function mail_gift($order, $user)
{
    global $INI;
    $week = array('S', 'M', 'T', 'W', 'T', 'F', 'S');
    $today = date('m.d.Y') . $week[date('w')];
    $vars = array('today' => $today, 'user' => $user, 'order' => $order, 'help_email' => $INI['subscribe']['helpemail'], 'help_mobile' => $INI['subscribe']['helpphone'], 'notice_email' => $INI['mail']['reply']);
    $message = render('mail_gift_info', $vars);
    //$mesasge = mb_convert_encoding($mesage, 'GBK', 'UTF-8');
    $options = array('contentType' => 'text/html', 'encoding' => 'UTF-8');
    $from = $INI['mail']['from'];
    $to = $user['email'];
    $subject = $INI['system']['sitename'] . ": Your Gift Card Details";
    if ($order['email']) {
        $to = $order['email'];
        $subject = "(Your gift from " . $order['from'] . ")" . $subject;
    }
    //$content=createpdf(render('mail_coupon_pdf',$vars));
    if ($INI['mail']['mail'] == 'mail') {
        Mailer::SendMail($from, $to, $subject, $message, $options);
    } else {
        Mailer::SmtpMail($from, $to, $subject, $message, $options);
        //,null,$content);
    }
}
Esempio n. 6
0
function mail_subscribemulti($teams,$subscribe) 
{
	global $INI;
	$encoding = $INI['mail']['encoding'] ? $INI['mail']['encoding'] : 'UTF-8';
	$week = array('日','一','二','三','四','五','六');
	$today = date('Y年n月j日 星期') . $week[date('w')];
	$first = array_shift($teams);
	$vars = array(
		'today' => $today,
		'first' => $first,
		'teams' => $teams,
		'subscribe' => $subscribe,
		'help_email' => $INI['mail']['helpemail'],
		'help_mobile' => $INI['mail']['helpphone'],
		'notice_email' => $INI['mail']['reply'],
	);
	$message = render('mail_subscribe_multiteam', $vars);
	$options = array(
		'contentType' => 'text/html',
		'encoding' => $encoding,
	);
	$from = $INI['mail']['from'];
	$to = $subscribe['email'];
	$subject = "夏天你不得不了解避暑大法,看看这些明星是怎么避暑的?";

	if ($INI['mail']['mail']=='mail') {
		Mailer::SendMail($from, $to, $subject, $message, $options);
	} else {
		Mailer::SmtpMail($from, $to, $subject, $message, $options);
	}
}
Esempio n. 7
0
$cli_args = arguments($argv);
$mai = new Mailer();
try {
    switch ($cli_args['type']) {
        case 'simple':
        default:
            $mai->setFrom("me", "my@mail");
            $mai->setTo("None", "panos");
            $mai->setSubject("Μία δοκιμή", "UTF-8");
            $mai->body = new Mailer_TextBody("test test");
            break;
        case 'utf':
            $mai->setFrom("Πάνος", "my@mail");
            $mai->setTo("Κανένας", "panos");
            $mai->setSubject("Μία δοκιμή", "UTF-8");
            $mai->body = new Mailer_TextBody("Δοκιμή κειμένου");
            break;
        case 'alt':
            $mai->setFrom("Πάνος", "my@mail");
            $mai->setTo("Κανένας", "panos");
            $mai->setSubject("Μία δοκιμή", "UTF-8");
            $mai->body = new Mailer_MultipartAlt();
            $mai->body->addPart(new Mailer_TextBody("Δοκιμή κειμένου"));
            $mai->body->addPart(new Mailer_HtmlBody("<html><body>Δοκιμή <u>κειμένου</u></body></html>"));
            break;
    }
    $mai->PrintMail();
    $mai->SendMail();
} catch (Exception $ex) {
    echo "\nException: " . $ex->getMessage() . "\n";
}
Esempio n. 8
0
function Send_Mails($dbg = 1, $dry = false)
{
    $dbhandle = A2Billing::DBHandle();
    if ($dbg > 2) {
        echo "Mailer: start\n";
    }
    $sqlTimeFmt = _("YYYY-MM-DD HH24:MI:SS TZ");
    // TODO: not only select, but lock mails in 'sending' state.
    $qry = "SELECT cc_mailings.id AS id, mtype, fromname, fromemail, subject, \n\t\tmessage, defargs, tomail, args, to_char(tstamp,'{$sqlTimeFmt}') AS mdate\n\t\tFROM cc_templatemail, cc_mailings\n\t\tWHERE cc_mailings.tmail_id = cc_templatemail.id\n\t\tAND (state = 1 OR state = 5);";
    $res = $dbhandle->Execute($qry);
    if (!$res) {
        if ($dbg > 0) {
            echo "Query Failed: " . $dbhandle->ErrorMsg() . "\n";
        }
        return false;
    } elseif ($res->EOF) {
        if ($dbg > 2) {
            echo "No mails need to be sent.\n";
        }
        return true;
    }
    try {
        while ($row = $res->fetchRow()) {
            if ($dbg > 2) {
                echo "Sending " . $row['mtype'] . " to " . $row['tomail'] . "\n";
            }
            if (empty($row['tomail'])) {
                if ($dbg > 2) {
                    echo "No recepient specified!\n";
                }
                continue;
            }
            $mai = new Mailer();
            $mai->setTo('', $row['tomail']);
            $mai->setFrom($row['fromname'], $row['fromemail']);
            // Format parameters
            $defargs = array();
            parse_str($row['defargs'], $defargs);
            $defargs['mdate'] = $row['mdate'];
            $toargs = array();
            parse_str($row['args'], $toargs);
            $args = array_merge($defargs, $toargs);
            if ($dbg > 2) {
                echo "Arguments:";
                print_r($args);
                echo "\n";
            }
            $mai->setSubject(str_alparams($row['subject'], $args), "UTF-8");
            $mai->body = new Mailer_TextBody(str_alparams($row['message'], $args));
            if ($dry) {
                $mai->PrintMail();
                continue;
            }
            try {
                if ($dbg > 2) {
                    echo "Sending mail..";
                }
                $mai->SendMail();
                if ($dbg > 2) {
                    echo " done.\n";
                }
                update_mailing($dbhandle, $row['id'], true, $dbg);
            } catch (Exception $ex) {
                if ($dbg > 2) {
                    echo " failed.\n";
                }
                update_mailing($dbhandle, $row['id'], false, $dbg);
                throw $ex;
            }
        }
    } catch (Exception $ex) {
        if ($dbg > 1) {
            echo "Exception: " . $ex->getMessage();
        }
    }
    return true;
}