当前位置: 首页>>代码示例>>PHP>>正文


PHP Mailer::SendMail方法代码示例

本文整理汇总了PHP中Mailer::SendMail方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::SendMail方法的具体用法?PHP Mailer::SendMail怎么用?PHP Mailer::SendMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mailer的用法示例。


在下文中一共展示了Mailer::SendMail方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendPaymentReminder

 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);
 }
开发者ID:rusty1909,项目名称:Navigator,代码行数:7,代码来源:PaymentMailer.php

示例2: SendMessagebyPHP

 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);
 }
开发者ID:rusty1909,项目名称:Navigator,代码行数:10,代码来源:Mailer.php

示例3: mail_subscribe

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);
    }
}
开发者ID:napoleonu,项目名称:repeat8.com,代码行数:17,代码来源:mailer.php

示例4: GenerateNewPassword

 public function GenerateNewPassword()
 {
     $connector = new Connector();
     $newPassword = $this->GeneratePassword();
     $sql = "";
     $sql .= " UPDATE members_info";
     $sql .= "\tSET password = '" . md5($newPassword) . "'";
     $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;
     }
 }
开发者ID:almazorajan,项目名称:upshiftexpress,代码行数:20,代码来源:classes.php

示例5: mail_gift

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);
    }
}
开发者ID:jowino,项目名称:bd786110cact,代码行数:24,代码来源:mailer.php

示例6: mail_subscribemulti

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);
	}
}
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:mailer.php

示例7: arguments

$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";
}
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:mailer-test.php

示例8: Send_Mails

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;
}
开发者ID:sayemk,项目名称:a2billing,代码行数:77,代码来源:Send_Mail.inc.php


注:本文中的Mailer::SendMail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。