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


PHP phpmailer::IssupportSendMail方法代码示例

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


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

示例1: supportSendMail

function supportSendMail($email, $name, $subject, $message, $response_flag = false)
{
    global $sendmethod, $sockethost, $smtpauth, $smtpauthuser, $smtpauthpass, $socketfrom, $socketfromname, $socketreply, $socketreplyname;
    include_once 'class.phpmailer.php';
    $mail = new phpmailer();
    if (file_exists('class/language/phpmailer.lang-en.php')) {
        $mail->SetLanguage('en', 'class/language/');
    } else {
        $mail->SetLanguage('en', '../class/language/');
    }
    if (isset($sendmethod) && $sendmethod == 'sendmail') {
        $mail->IssupportSendMail();
    } elseif (isset($sendmethod) && $sendmethod == 'smtp') {
        $mail->IsSMTP();
    } elseif (isset($sendmethod) && $sendmethod == 'mail') {
        $mail->IsMail();
    } elseif (isset($sendmethod) && $sendmethod == 'qmail') {
        $mail->IsQmail();
    }
    $mail->Host = $sockethost;
    if ($smtpauth == 'TRUE') {
        $mail->SMTPAuth = true;
        $mail->Username = $smtpauthuser;
        $mail->Password = $smtpauthpass;
    }
    if (!$response_flag && isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
        $mail->From = $email;
        $mail->FromName = $name;
        $mail->AddReplyTo($email, $name);
    } else {
        $mail->From = $socketfrom;
        $mail->FromName = $socketfromname;
        $mail->AddReplyTo($socketreply, $socketreplyname);
    }
    $mail->IsHTML(False);
    $mail->Body = $message;
    $mail->Subject = $subject;
    if (!$response_flag && isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
        $mail->AddAddress($socketfrom, $socketfromname);
    } else {
        $mail->AddAddress($email, $name);
    }
    if (!$mail->Send()) {
        return 'Error: ' . $mail->ErrorInfo;
    } else {
        return 'Email Sent. ' . $mail->ErrorInfo;
    }
    $mail->ClearAddresses();
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:49,代码来源:functions.php


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