Баг с определением доступа. Альтернативная почта. Выбор документов
This commit is contained in:
parent
a48bce8552
commit
a3c988b2c3
4 changed files with 94 additions and 1 deletions
90
src/MailAlt.php
Normal file
90
src/MailAlt.php
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
class MailAlt
|
||||
{
|
||||
public $mailer;
|
||||
|
||||
function __construct() {
|
||||
$this->mailer = new PHPMailer();
|
||||
$this->mailer->CharSet = 'UTF-8';
|
||||
}
|
||||
|
||||
/**
|
||||
* Установка отправителя
|
||||
*/
|
||||
function from($name)
|
||||
{
|
||||
$this->mailer->setFrom($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Установка получателя
|
||||
*/
|
||||
function to($name) // recipient
|
||||
{
|
||||
$this->mailer->addAddress($name);
|
||||
}
|
||||
|
||||
function replyTo($name) // recipient
|
||||
{
|
||||
$this->mailer->AddReplyTo($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Установка получателей копии
|
||||
*/
|
||||
function copy($name) // recipient cc
|
||||
{
|
||||
$this->addCC($name);
|
||||
}
|
||||
|
||||
function notify($notify)
|
||||
{
|
||||
$this->_notify = $notify;
|
||||
}
|
||||
|
||||
/**
|
||||
* Тема письма
|
||||
*/
|
||||
function subject($subject)
|
||||
{
|
||||
$this->mailer->Subject = $subject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Текст письма
|
||||
*/
|
||||
function setContent($text)
|
||||
{
|
||||
$this->mailer->Body = $text;
|
||||
}
|
||||
|
||||
function setType($text)
|
||||
{
|
||||
$this->mailer->isHTML($text == 'text/html');
|
||||
}
|
||||
|
||||
/**
|
||||
* Кодировка текста в письме
|
||||
*/
|
||||
function setEncoding($encoding)
|
||||
{
|
||||
$this->encoding = $encoding;
|
||||
}
|
||||
|
||||
/**
|
||||
* Добавление вложения из файла
|
||||
*/
|
||||
function addAttachment($filename, $name = false)
|
||||
{
|
||||
$this->mailer->addAttachment($filename, $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Отправка почты
|
||||
*/
|
||||
function send()
|
||||
{
|
||||
return $this->mailer->send();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue