本文整理匯總了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();
}