本文整理汇总了PHP中PHPMailer::isHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPMailer::isHtml方法的具体用法?PHP PHPMailer::isHtml怎么用?PHP PHPMailer::isHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPMailer
的用法示例。
在下文中一共展示了PHPMailer::isHtml方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PHPMailer
<?php
require 'PHPMailer/PHPMailerAutoload.php';
//Instancion a PHPMailer
$mail = new PHPMailer();
//Direccion de Email del destinatario
$to = "redzilla@gmail.com";
// recogeremos los datos del formulario
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$mensaje = $_POST['message'];
//Validamos que los campos no esten vacios o nulos
if ($nombre == " " || $email == " " || $mensaje == " ") {
echo '<div class="alert alert-block alert-danger">
<button type="button" class="close" data-dismiss="alert">×</button>
Todos los campos son requeridos para el envio</div>';
} else {
//Estrcutura del mensaje usando mail
$mail->From = $email;
$mail->FromName = $nombre;
$mail->addAddress($to);
$mail->Subject = "Mensaje Natural Way";
$mail->isHtml(true);
$mail->Body = 'La siguiente persona: <strong>' . $nombre . '</strong> Ha dejado el siguiente mensaje</br></br>' . '<strong>Mensaje:</strong>' . ' ' . $mensaje . '</br></br>';
$mail->CharSet = 'UTF-8';
$mail->send();
//Respuesta
echo '<div class="alert alert-block alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Mensaje enviado correctamente.</strong></div>';
}
示例2: response
function response($request)
{
global $smtp_config;
parse_str($request, $request);
$response = new stdClass();
$action = getSafe($request, 'action', 'page');
$news_file = 'server_data/news.json';
$news = file_get_contents($news_file);
$news = json_decode($news);
$images = file_get_contents('server_data/images.json');
$images = json_decode($images);
$tariffs = file_get_contents('server_data/tariffs.json');
$tariffs = json_decode($tariffs);
if (!$news || !$images) {
$response->type = 'error';
$response->message = 'Server files errors!';
return_json($response);
}
$NPP = 6;
// news per page
$NN = count($news->news);
// news number
switch ($action) {
case 'tariffs':
$ttype = getSafe($request, 'ttype', false);
$response->type = 'success';
$response->data = new stdClass();
if (!$ttype) {
$response->data->tariffs = $tariffs->tariffs;
} else {
$response->data->tariffs = $tariffs->tariffs->{$ttype};
}
break;
case 'captcha':
$request = $_POST;
$reset = getSafe($request, 'reset', false);
$captcha = getSafe($request, 'captcha');
session_start();
if ($reset) {
session_destroy();
$response->type = 'success';
} else {
if ($_SESSION['code'] == $captcha) {
$response->type = 'success';
} else {
$response->type = 'error';
}
$response->code = $_SESSION['code'];
}
break;
case 'mail':
$request = $_POST;
$subject = 'Сообщение с сайта УНИКО';
$message = getSafe($request, 'message');
$headers = 'From: unico@vgg.ru' . "\r\n" . "Content-Type: text; charset=utf-8";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = $smtp_config['host'];
$mail->SMTPAuth = true;
$mail->Port = $smtp_config['port'];
$mail->Username = $smtp_config['username'];
$mail->Password = $smtp_config['password'];
$mail->CharSet = 'UTF-8';
$mail->SetFrom(FROM_MAIL, 'Унико');
$mail->Subject = $subject;
$mail->isHtml(false);
$mail->Body = $message;
$addresses = explode(' ', UNICO_MAIL);
foreach ($addresses as $address) {
$mail->AddAddress($address);
}
if ($mail->Send()) {
$response->type = 'success';
} else {
$response->type = 'error';
}
break;
case 'igroups':
$response->type = 'success';
$response->data = new stdClass();
$response->data->groups = $images->groups;
break;
case 'images':
$group = getSafe($request, 'g');
if ($group) {
foreach ($images->groups as $i) {
if ($i->id == $group) {
$group = $i;
break;
}
}
}
$response->type = 'success';
$response->data = new stdClass();
$images_output = array();
foreach ($images->images as $i) {
if (is_object($group)) {
if (!in_array($i->id, $group->images)) {
continue;
}
//.........这里部分代码省略.........
示例3: sendEmail
/**
* sendEmail()
*
* @return
*/
function sendEmail($subject, $textMail, $email, $textMailAlt = "")
{
global $LANG;
include $_SESSION['settings']['cpassman_dir'] . '/includes/settings.php';
//load library
require_once $_SESSION['settings']['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
require $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Email/Phpmailer/PHPMailerAutoload.php';
// load PHPMailer
$mail = new PHPMailer();
// send to user
$mail->setLanguage("en", "../includes/libraries/Email/Phpmailer/language/");
$mail->SMTPDebug = 0;
//value 1 can be used to debug
$mail->Port = $_SESSION['settings']['email_port'];
//COULD BE USED
$mail->CharSet = "utf-8";
// $mail->SMTPSecure = 'ssl'; //COULD BE USED
$smtp_security = $_SESSION['settings']['email_security'];
if ($smtp_security == "tls" || $smtp_security == "ssl") {
$mail->SMTPSecure = $smtp_security;
}
$mail->isSmtp();
// send via SMTP
$mail->Host = $_SESSION['settings']['email_smtp_server'];
// SMTP servers
$mail->SMTPAuth = $_SESSION['settings']['email_smtp_auth'] == 'true' ? true : false;
// turn on SMTP authentication
$mail->Username = $_SESSION['settings']['email_auth_username'];
// SMTP username
$mail->Password = $_SESSION['settings']['email_auth_pwd'];
// SMTP password
$mail->From = $_SESSION['settings']['email_from'];
$mail->FromName = $_SESSION['settings']['email_from_name'];
$mail->addAddress($email);
//Destinataire
$mail->WordWrap = 80;
// set word wrap
$mail->isHtml(true);
// send as HTML
$mail->Subject = $subject;
$mail->Body = $textMail;
$mail->AltBody = $textMailAlt;
// send email
if (!$mail->send()) {
return '"error":"error_mail_not_send" , "message":"' . $mail->ErrorInfo . '"';
} else {
return '"error":"" , "message":"' . $LANG['forgot_my_pw_email_sent'] . '"';
}
}
示例4: questions
Его почта: ' . $mailEmail . '
<br>Комментарий: ' . $mailComment . '<br>
<a href= http://pashebor.rurs.net/mozaika/answerController.php>Ссылка на контроллер </a>';
if (isset($btn)) {
$query = mysql_query("insert into questions(name, email, answered, question) values ('{$name}', '{$email}', '{$answered}', '{$comment}')");
$mailer = new PHPMailer();
$mailer->isSMTP();
$mailer->Host = 'smtp.mail.ru';
$mailer->SMTPAuth = true;
$mailer->Username = 'milena.studio@mail.ru';
//Логин
$mailer->Password = '3vc4erdf';
//пароль
$mailer->SMTPSecure = 'ssl';
$mailer->Port = '465';
$mailer->CharSet = 'UTF-8';
$mailer->From = 'milena.studio@mail.ru';
$mailer->FromName = 'Milena Studio';
$mailer->addAddress('pashebor@gmail.com', 'Milena Studio');
$mailer->addAddress('milena.studio@mail.ru', 'Milena Studio');
$mailer->isHtml(true);
$mailer->Subject = 'Комментарий';
$mailer->Body = $message;
if ($query && $mailer->send()) {
echo "<!DOCTYPE html>\n<html>\n<meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />\n<meta name='viewport' content='width=device-width, initial-scale=0.4'/>\n<head>\n <title>Milena Studio</title>\n <link rel='shortcut icon' href='img/iconLogo.png' />\n\n\n\n <link rel='stylesheet' href='../css/text.css'>\n <link rel='stylesheet' href='../css/delivery.css'>\n <link rel='stylesheet' href='../css/skeleton.css'>\n <link rel='stylesheet' href='../css/start.css'>\n <link rel='stylesheet' href='../css/hover.css'>\n <link rel='stylesheet' href='../css/normalize.css'>\n <link rel='stylesheet' href='../css/slicknav.css'>\n <link rel='stylesheet' href='../css/animations.css'>\n <link rel='shortcut icon' href='../img/iconLogo.png'>\n\n <style>\n body{\n\n background-color: #000000;\n }\n input:focus{\n outline: none;\n }\n\n @font-face {\n font-family: Archive;\n src: url(../fonts/ArchiveRegular.ttf);\n }\n\n @font-face {\n font-family: Magistral;\n src: url(../fonts/MagistralC.otf);\n }\n\n\n a{\n color: #000000;\n text-decoration: none;\n }\n </style>\n</head>\n\n<body>\n <div class='container'>\n\n <div class='row'>\n <div class='twelve columns boxList' style='margin-top: 250px' align='center'>\n <a href='../reviews'> <img src='close.png' width='48px' class='rotateClose' style='margin-top: -35px; margin-left: 98% '\n onmouseover='this.src='close2.png''\n onmouseout='this.src='close.png''/></a>\n <p style='font-family: Archive; font-size: 20pt; color: #F9C857; text-align: center; margin-top: -15px' class='floating'>Отзыв отправлен</p>\n\n\n <p style='font-family: Magistral; font-size: 16pt; color: #000000 '>Большое спасибо за ваш отзыв, он будет опубликован на сайте после проверки администратова в ближайшее время.</p>\n\n </div>\n\n </div>\n\n </div>\n\n</body>\n</html>";
}
exit;
} else {
echo "'status':'error'";
exit;
}
示例5: explode
}
$mail->Subject = Setup::$settings['alert_subject'];
$mail->isHtml(true);
$mail->Body = "{$noticeMessage} {$summary} {$table} {$footer}";
$mail->Send();
}
// text message
$e = explode("\n", $user['textMessageEmails']);
if (count($e) > 0 && Setup::$settings['smtp_server'] != '') {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = Setup::$settings['smtp_server'];
$mail->From = Setup::$settings['from_email'];
$mail->FromName = Setup::$settings['from_name'];
foreach ($e as $a) {
if (trim($a) != '') {
$mail->AddAddress($a);
}
}
$mail->Subject = Setup::$settings['alert_subject_sms'];
$mail->isHtml(false);
$mail->Body = "{$url}/hosts.php?oc=1 {$summaryText}";
$mail->Send();
}
if ($user['twitterHandle'] != '') {
$t = new Twitter();
$t->message($user['twitterHandle'], $summaryText);
}
_Logging::appLog("user alert sent");
}
_Logging::appLog("user job ended");
示例6: correo
function correo($request)
{
$mail = new PHPMailer();
$mail->setFrom($request->correo, $request->nombre);
//quien lo envia. Remitente
$mail->addAddress('reickchozo@gmail.com');
//A quien llega. El receptor
$mail->Subject = $request->asunto;
//Aqui va el asunto del mensaje
$mail->isHtml(true);
$body = "<h3>Contacto a MetaHerrera</h3>\n <p><b>Nombre: </b>{$request->nombre}</p>\n <p><b>Correo: </b>{$request->correo}</p>\n <p><b>Asunto: </b>{$request->asunto}</p> \n <p><b>Mensaje: </b>{$request->mensaje}</p>\n <p><b>Fecha: </b>" . date('Y-m-d') . "</p>";
$mail->Body = $body;
if ($mail->send()) {
echo "Funciono";
}
}
示例7: customMail
function customMail($target, $subject, $msg)
{
//require_once ('Neuron/Core/PHPMailer.php');
$mail = new PHPMailer();
if (defined('EMAIL_SMTP_SERVER')) {
$mail->IsSMTP();
// send via SMTP
$mail->Host = EMAIL_SMTP_SERVER;
// SMTP servers
$mail->Port = EMAIL_SMTP_PORT;
if (defined('EMAIL_SMTP_USERNAME')) {
$mail->SMTPAuth = true;
// turn on SMTP authentication
if (defined('EMAIL_SMTP_SECURE')) {
$mail->SMTPSecure = EMAIL_SMTP_SECURE;
}
$mail->Username = EMAIL_SMTP_USERNAME;
// SMTP username
$mail->Password = EMAIL_SMTP_PASSWORD;
// SMTP password
}
}
$mail->SMTPDebug = EMAIL_DEBUG_LEVEL;
$from = EMAIL_FROM;
if (empty($from)) {
$from = 'support@catlab.be';
}
$mail->From = $from;
$mail->FromName = EMAIL_FROM_NAME;
$mail->CharSet = 'utf-8';
$mail->isHtml(false);
$mail->AddAddress($target);
$mail->Subject = $subject;
$mail->Body = $msg;
if (!$mail->send()) {
throw new \Exception("Mail could not be send: " . $mail->ErrorInfo);
}
}