]>
git.wh0rd.org - tt-rss.git/blob - classes/ttrssmailer.php
3 * @brief A TTRSS extension to the PHPMailer class
4 * Configures default values through the __construct() function
5 * @author Derek Murawsky
9 require_once 'lib/phpmailer/class.phpmailer.php';
10 require_once "config.php";
12 class ttrssMailer
extends PHPMailer
{
14 //define all items that we want to override with defaults in PHPMailer
15 public $From = SMTP_FROM_ADDRESS
;
16 public $FromName = SMTP_FROM_NAME
;
17 public $CharSet = "UTF-8";
18 public $PluginDir = "lib/phpmailer/";
19 public $ContentType = "text/html"; //default email type is HTML
22 public $SMTPAuth=False;
26 function __construct() {
27 $this->SetLanguage("en", "lib/phpmailer/language/");
28 //if SMTP_HOST is specified, use SMTP to send mail directly
33 //if SMTP_PORT is specified, assign it. Otherwise default to port 25
40 //if SMTP_LOGIN is specified, set credentials and enable auth
43 $Username = SMTP_LOGIN
;
44 $Password = SMTP_PASSWORD
;
47 /* @brief a simple mail function to send email using the defaults
48 * This will send an HTML email using the configured defaults
49 * @param $toAddress A string with the recipients email address
50 * @param $toName A string with the recipients name
51 * @param $subject A string with the emails subject
52 * @param $body A string containing the body of the email
54 public function quickMail ($toAddress, $toName, $subject, $body, $altbody=""){
55 $this->addAddress($toAddress, $toName);
56 $this->Subject
= $subject;
58 $this->IsHTML($altbody != '');