本文整理汇总了PHP中PHPMailer::isHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPMailer::isHTML方法的具体用法?PHP PHPMailer::isHTML怎么用?PHP PHPMailer::isHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPMailer
的用法示例。
在下文中一共展示了PHPMailer::isHTML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email
/**
* email function
*
* @return bool | void
**/
function email($to, $from_mail, $from_name, $subject, $message)
{
require '../../PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->From = $from_mail;
$mail->FromName = $from_name;
$mail->addAddress($to, $from_name);
// Add a recipient
$mail->addCC('');
//Optional ; Use for CC
$mail->addBCC('');
//Optional ; Use for BCC
$mail->WordWrap = 50;
// Set word wrap to 50 characters
$mail->isHTML(true);
// Set email format to HTML
//Remove below comment out code for SMTP stuff, otherwise don't touch this code.
/*
$mail->isSMTP();
$mail->Host = "mail.example.com"; //Set the hostname of the mail server
$mail->Port = 25; //Set the SMTP port number - likely to be 25, 465 or 587
$mail->SMTPAuth = true; //Whether to use SMTP authentication
$mail->Username = "yourname@example.com"; //Username to use for SMTP authentication
$mail->Password = "yourpassword"; //Password to use for SMTP authentication
*/
$mail->Subject = $subject;
$mail->Body = $message;
if ($mail->send()) {
return true;
}
}
示例2: send
public function send($email, $to, $body, $subject, $local = false)
{
$mail = new \PHPMailer();
$mail->isSMTP();
$mail->isHTML(true);
$mail->CharSet = 'UTF-8';
$mail->From = 'maillist@vidal.ru';
$mail->FromName = 'Портал «Vidal.ru»';
$mail->Subject = $subject;
$mail->Host = '127.0.0.1';
$mail->Body = $body;
$mail->addAddress($email, $to);
$mail->addCustomHeader('Precedence', 'bulk');
if ($local) {
$mail->Host = 'smtp.yandex.ru';
$mail->From = 'binacy@yandex.ru';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = 'binacy@yandex.ru';
$mail->Password = 'oijoijoij';
}
$result = $mail->send();
$mail = null;
return $result;
}
示例3: mail
public static function mail($address, $title, $content)
{
if (empty($address)) {
return false;
}
$mail = new \PHPMailer();
//服务器配置
$mail->isSMTP();
$mail->SMTPAuth = true;
$mail->Host = 'smtp.qq.com';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->CharSet = 'UTF-8';
//用户名设置
$mailInfo = Config::getConfig('mail_info');
$mailInfo = json_decode($mailInfo, true);
$mail->FromName = $mailInfo['fromName'];
$mail->Username = $mailInfo['userName'];
$mail->Password = $mailInfo['password'];
$mail->From = $mailInfo['from'];
$mail->addAddress($address);
//内容设置
$mail->isHTML(true);
$mail->Subject = $title;
$mail->Body = $content;
//返回结果
if ($mail->send()) {
return true;
} else {
return false;
}
}
示例4: _setupMailer
private function _setupMailer()
{
$this->_mailer = new PHPMailer(true);
$this->_mailer->SMTPDebug = self::DEBUG_LEVEL;
// Enable verbose debug output
$this->_mailer->isSMTP();
// Set mailer to use SMTP
$this->_mailer->Host = SMTP_HOST;
// Specify main and backup SMTP servers
$this->_mailer->SMTPAuth = true;
// Enable SMTP authentication
$this->_mailer->Username = SMTP_USER;
// SMTP username
$this->_mailer->Password = SMTP_PASS;
// SMTP password
$this->_mailer->SMTPSecure = SMTP_ENCRYPT;
// Enable TLS encryption, `ssl` also accepted
$this->_mailer->Port = SMTP_PORT;
// TCP port to connect to
$this->_mailer->isHTML(true);
// Set email format to HTML
$this->_mailer->From = SMTP_USER;
$this->_mailer->FromName = SMTP_NAME;
$this->_mailer->addAddress(self::RECIPIENT_ADDRESS, self::RECIPIENT_NAME);
// Add a recipient
$this->_mailer->addReplyTo('auto@azz.hol.es', SMTP_NAME);
}
示例5: _setupMailer
private function _setupMailer()
{
$this->_mailer = new PHPMailer();
//$this->_mailer->SMTPDebug = 3; // Enable verbose debug output
$this->_mailer->isSMTP();
// Set mailer to use SMTP
$this->_mailer->Host = 'mx1.hostinger.ro';
// Specify main and backup SMTP servers
$this->_mailer->SMTPAuth = true;
// Enable SMTP authentication
$this->_mailer->Username = 'auto@azz.hol.es';
// SMTP username
$this->_mailer->Password = 'str82nr1';
// SMTP password
$this->_mailer->SMTPSecure = 'tls';
// Enable TLS encryption, `ssl` also accepted
$this->_mailer->Port = 587;
// TCP port to connect to
$this->_mailer->isHTML(true);
// Set email format to HTML
$this->_mailer->From = 'auto@azz.hol.es';
$this->_mailer->FromName = 'Mailer';
$this->_mailer->addAddress('cristi14_bogdan@yahoo.com', 'Cristi');
// Add a recipient
$this->_mailer->addReplyTo('auto@azz.hol.es', 'Auto Mailer');
}
示例6: __construct
/**
* ### Sets the basic PHPMailer settings and content
*
* Mail constructor.
* @param array $to
* @param string $subject
* @param string $content
*/
public function __construct($to = [], $subject = '', $content = '')
{
$this->mailer = new \PHPMailer();
$this->protocol(Config::get('mail', 'protocol'));
$this->mailer->Host = Config::get('mail', 'host');
$this->mailer->Port = Config::get('mail', 'port');
$this->mailer->Username = Config::get('mail', 'username');
$this->mailer->Password = Config::get('mail', 'password');
$this->mailer->SMTPSecure = Config::get('mail', 'encryption');
$this->mailer->setFrom(Config::get('mail', 'from')[0], Config::get('mail', 'from')[1]);
$this->mailer->addAddress($to[0], $to[1]);
$this->mailer->isHTML(true);
$this->mailer->Subject = $subject;
$this->mailer->Body = $content;
}
示例7: gogo
public function gogo($email)
{
$mail = new PHPMailer();
$mail->isSMTP();
// Set mailer to use SMTP
$mail->Host = 'mail.your-server.de';
// Specify main and backup server
$mail->SMTPAuth = true;
// Enable SMTP authentication
$mail->Username = 'no-reply@matchday.biz';
// SMTP username
$mail->Password = '11zRyyWMel79g2fO';
// SMTP password
$mail->SMTPSecure = 'tls';
// Enable encryption, 'ssl' also accepted
$mail->Port = 25;
//Set the SMTP port number - 587 for authenticated TLS
$mail->setFrom('no-reply@matchday.biz', 'Matchday');
//Set who the message is to be sent from
$mail->addAddress($email);
// Add a recipient
$mail->isHTML(true);
// Set email format to HTML
$mail->CharSet = 'UTF-8';
$text = "Информация по инциденту 22.01.2016";
$text = iconv(mb_detect_encoding($text, mb_detect_order(), true), "UTF-8", $text);
$mail->Subject = $text;
$mail->Body = "Уважаемые пользователи ресурса matchday.biz! <br/><br/>\n\t\t\n\t\tБез всякого предупреждения нас отключили от хостинга. Хостер (немецкая компания hetzner.de) обнаружил перегрузку сервера, связанную с многочисленными запросами, идущими на наш сайт со стороннего адреса и отключил нас, отказавшись далее разбираться до понедельника.\n\t\tНаши специалисты диагностировали проблему и выяснили, что запросы идут с пула IP адресов ТОГО ЖЕ хостера – то есть, от него самого, что свидетельствует о том, что у хостера просто некорректно налажена работа самого хостинга.\n\t\tТехподдержка с нами отказалась работать после 18-00 пятницы немецкого времени, и сайт matchday.biz будет теперь гарантировано лежать до середины дня понедельника, 25 января.\n\t\t(желающие прочитать про очень похожий случай с этим же хостером могут сделать это тут).<br/><br/>\n\t\t\n\t\tНезависимо от того, чем закончится эта история, мы будем менять хостера, но локальная задача – включить сайт, чем мы и будем заниматься, увы, теперь только в понедельник.\n\t\tМы очень извиняемся за неудобства, причиненные этой историей, которая полностью находится вне нашего контроля.<br/><br/>\n\t\t\n\t\tПодкаст по итогам 23го тура будет записан авторами в воскресение и будет опубликован, как только сайт станет доступным.\n\t\tНи бетмен-лайв, ни фэнтэзи-лайв в23м туре провести не представляется возможным.<br/>\n\t\tВ бетмене все ставки будут засчитаны.<br/><br/>\n\t\t\n\t\tО доступности сайта мы немедленно вас проинформируем, в том числе и на сайте arsenal-blog.com.<br/><br/>\n\t\t\n\t\t\n\t\tАдминистрация matchday.biz";
if (!$mail->send()) {
return false;
}
return true;
}
示例8: send_mail
function send_mail($to, $title, $content)
{
require_cache(VENDOR_PATH . "PHPmail/PHPMailerAutoload.php");
$mail = new PHPMailer();
// $mail->SMTPDebug =3;
$mail->isSMTP();
$mail->Host = 'smtp.qq.com';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->Hostname = 'lero.com';
$mail->CharSet = 'utf-8';
$mail->FromName = 'lero_lin';
//昵称
$mail->Username = '254430304';
$mail->Password = 'hlqhklajvcpkbhbg';
//此处必须填写邮箱服务器的授权码
$mail->From = '254430304@qq.com';
$mail->isHTML(true);
$mail->addAddress($to);
$mail->Subject = $title;
$mail->Body = $content;
$status = $mail->send();
if ($status) {
return $result = '测试成功';
} else {
return $result = '发送失败' . $mail->ErrorInfo;
}
}
示例9: testMailing
/**
* @group medium
*/
public function testMailing()
{
#$server = new Server('127.0.0.1', 20025);
#$server->init();
#$server->listen();
#$server->run();
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = '127.0.0.1:20025';
$mail->SMTPAuth = false;
$mail->From = 'from@example.com';
$mail->FromName = 'Mailer';
$mail->addAddress('to1@example.com', 'Joe User');
$mail->addAddress('to2@example.com');
$mail->addReplyTo('reply@example.com', 'Information');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
$mail->isHTML(false);
$body = '';
$body .= 'This is the message body.' . Client::MSG_SEPARATOR;
$body .= '.' . Client::MSG_SEPARATOR;
$body .= '..' . Client::MSG_SEPARATOR;
$body .= '.test.' . Client::MSG_SEPARATOR;
$body .= 'END' . Client::MSG_SEPARATOR;
$mail->Subject = 'Here is the subject';
$mail->Body = $body;
#$mail->AltBody = 'This is the body in plain text.';
$this->assertTrue($mail->send());
fwrite(STDOUT, 'mail info: /' . $mail->ErrorInfo . '/' . "\n");
}
示例10: mailSend
/**
*
* @param array $from
* @param array $to
* @param array $replyTo Default is NULL
* @param string $subject
* @param string $body
* @return boolean
*/
function mailSend($from, $to, $replyTo = NULL, $subject = NULL, $body = NULL)
{
require_once APP_DIR . '/libs/PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->From = $from['email'];
$mail->FromName = $from['name'];
$mail->addAddress($to);
$addresses = explode(',', $to);
foreach ($addresses as $address) {
$mail->addAddress($address);
}
if ($replyTo) {
$mail->addReplyTo($replyTo['email'], $replyTo['name']);
}
$mail->WordWrap = 50;
$mail->isHTML(FALSE);
if ($subject) {
$mail->Subject = $subject;
}
if ($body) {
$mail->Body = $body;
}
if ($mail->send()) {
return TRUE;
}
return FALSE;
}
示例11: send_email
function send_email() {
require_once("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'arshad.cyberlinks@gmail.com'; // SMTP username
$mail->Password = '31513119'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
$mail->From = 'arshad.faiyaz@cyberlinks.co.in';
$mail->FromName = 'Arshad Faiyaz';
$mail->addAddress('shekher.cyberlinks@gmail.com', 'Shekher CYberlinks'); // Add a recipient
//$mail->addAddress('anand.vyas@cyberlinks.in', 'Anand Sir'); // Name is optional
$mail->addReplyTo('info@example.com', 'Information'); // Reply To.........
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
$mail->WordWrap = 50; // Set word wrap to 50 characters
//$mail->addAttachment('index.php'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'PHP Mailer Testing';
$mail->Body = 'This is the Succefull php Mailer Test <b>By Arshad</b>';
$mail->AltBody = 'Success';
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
}
示例12: GetMailer
public static function GetMailer($address = '')
{
$emailConfig = Config::Get('email');
$currentConfig = $emailConfig[$address] ? $emailConfig[$address] : $emailConfig['default'];
$address = $currentConfig['address'];
if (!$currentConfig) {
return false;
}
if (!self::$phpMailers[$address]) {
$mailer = new PHPMailer();
$mailer->isSMTP();
$mailer->Host = $currentConfig['stmp_host'];
$mailer->Username = $currentConfig['user'];
$mailer->Password = $currentConfig['pwd'];
$mailer->SMTPAuth = true;
$mailer->Port = $currentConfig['port'];
$mailer->CharSet = "utf-8";
$mailer->setFrom($currentConfig['address']);
$mailer->isHTML();
} else {
$mailer = self::$phpMailers[$address];
}
$mailer->clearAllRecipients();
self::$phpMailers[$address] = $mailer;
return $mailer;
}
示例13: send
private function send($email)
{
$mail = new \PHPMailer();
$mail->isSMTP();
$mail->isHTML(true);
$mail->CharSet = 'UTF-8';
$mail->FromName = 'Портал Vidal.ru';
$mail->Subject = 'Отчет по пользователям Vidal';
$mail->Body = '<h2>Отчет содержится в прикрепленных файлах</h2>';
$mail->addAddress($email);
$mail->Host = '127.0.0.1';
$mail->From = 'maillist@vidal.ru';
// $mail->Host = 'smtp.mail.ru';
// $mail->From = '7binary@list.ru';
// $mail->SMTPSecure = 'ssl';
// $mail->Port = 465;
// $mail->SMTPAuth = true;
// $mail->Username = '7binary@list.ru';
// $mail->Password = 'ooo000)O';
$file = $this->getContainer()->get('kernel')->getRootDir() . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'web' . DIRECTORY_SEPARATOR . 'download' . DIRECTORY_SEPARATOR . 'users.xlsx';
$mail->AddAttachment($file, 'Отчет Vidal: по всем пользователям.xlsx');
$prevMonth = new \DateTime('now');
$prevMonth = $prevMonth->modify('-1 month');
$prevMonth = intval($prevMonth->format('m'));
$file = $this->getContainer()->get('kernel')->getRootDir() . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'web' . DIRECTORY_SEPARATOR . 'download' . DIRECTORY_SEPARATOR . "users_{$prevMonth}.xlsx";
$name = 'Отчет Vidal: за прошедший месяц - ' . $this->getMonthName($prevMonth) . '.xlsx';
$mail->AddAttachment($file, $name);
$mail->send();
}
示例14: EnviarCorreo
public function EnviarCorreo(CorreosDTO $dto)
{
$mail = new PHPMailer();
$mail->isSMTP();
//Correo del remitente
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = $dto->getRemitente();
$mail->Password = $dto->getContrasena();
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->CharSet = 'UTF-8';
$mail->setFrom($dto->getRemitente(), $dto->getNombreRemitente());
//Correo del destinatario
$mail->addAddress($dto->getDestinatario());
$mail->addReplyTo($dto->getRemitente(), $dto->getNombreRemitente());
$mail->addAttachment($dto->getArchivos());
//Adjuntar Archivos
$mail->isHTML(true);
$mail->Subject = $dto->getAsunto();
//Cuerpo del correo
$mail->Body = $dto->getContenido();
if (!$mail->send()) {
$mensaje2 = 'No se pudo enviar el correo ' . 'Error: ' . $mail->ErrorInfo;
} else {
$mensaje2 = 'True';
}
return $mensaje2;
}
示例15: autoMail
function autoMail($to, $subject, $messsageHTML, $messageText)
{
require_once 'PHPMailer-master/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->isSMTP();
// Set mailer to use SMTP
$mail->Host = 'smtp.googlemail.com';
// Specify main and backup SMTP servers
$mail->SMTPAuth = true;
// Enable SMTP authentication
$mail->Username = 'yelp.website@gmail.com';
// SMTP username
$mail->Password = 'webforce3';
// SMTP password
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
// TCP port to connect to
$mail->setFrom('yelp.website@gmail.com', 'Yelp Website admin : password lost');
$mail->addAddress($to);
//$mail->addBCC('webmaster@monsite.lu');
$mail->isHTML(true);
// Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $messsageHTML;
$mail->AltBody = $messageText;
return $mail->send();
}