* Holds the most recent mailer error message.
* @var string
*/
- var $ErrorInfo = '';
+ var $ErrorInfo = "";
/**
* Sets the From email address for the message.
* will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
* @var string
*/
- var $Sender = '';
+ var $Sender = "";
/**
* Sets the Subject of the message.
* @var string
*/
- var $Subject = '';
+ var $Subject = "";
/**
* Sets the Body of the message. This can be either an HTML or text body.
* If HTML then run IsHTML(true).
* @var string
*/
- var $Body = '';
+ var $Body = "";
/**
* Sets the text-only body of the message. This automatically sets the
* that can read HTML will view the normal Body.
* @var string
*/
- var $AltBody = '';
+ var $AltBody = "";
/**
* Sets word wrapping on the body of the message to a given number of
* is in a different directory than the PHP include path.
* @var string
*/
- var $PluginDir = '';
+ var $PluginDir = "";
/**
* Holds PHPMailer version.
* Sets the email address that a reading confirmation will be sent.
* @var string
*/
- var $ConfirmReadingTo = '';
+ var $ConfirmReadingTo = "";
/**
* Sets the hostname to use in Message-Id and Received headers
* by SERVER_NAME is used or 'localhost.localdomain'.
* @var string
*/
- var $Hostname = '';
+ var $Hostname = "";
/////////////////////////////////////////////////
// PROPERTIES FOR SMTP
* Sets the SMTP HELO of the message (Default is $Hostname).
* @var string
*/
- var $Helo = '';
+ var $Helo = "";
/**
* Sets connection prefix.
* Sets SMTP username.
* @var string
*/
- var $Username = '';
+ var $Username = "";
/**
* Sets SMTP password.
* @var string
*/
- var $Password = '';
+ var $Password = "";
/**
* Sets the SMTP server timeout in seconds. This function will not
var $ReplyTo = array();
var $attachment = array();
var $CustomHeader = array();
- var $message_type = '';
+ var $message_type = "";
var $boundary = array();
var $language = array();
var $error_count = 0;
* @param string $name
* @return void
*/
- function AddAddress($address, $name = '') {
+ function AddAddress($address, $name = "") {
$cur = count($this->to);
$this->to[$cur][0] = trim($address);
$this->to[$cur][1] = $name;
* @param string $name
* @return void
*/
- function AddCC($address, $name = '') {
+ function AddCC($address, $name = "") {
$cur = count($this->cc);
$this->cc[$cur][0] = trim($address);
$this->cc[$cur][1] = $name;
* @param string $name
* @return void
*/
- function AddBCC($address, $name = '') {
+ function AddBCC($address, $name = "") {
$cur = count($this->bcc);
$this->bcc[$cur][0] = trim($address);
$this->bcc[$cur][1] = $name;
* @param string $name
* @return void
*/
- function AddReplyTo($address, $name = '') {
+ function AddReplyTo($address, $name = "") {
$cur = count($this->ReplyTo);
$this->ReplyTo[$cur][0] = trim($address);
$this->ReplyTo[$cur][1] = $name;
* @return bool
*/
function Send() {
- $header = '';
- $body = '';
+ $header = "";
+ $body = "";
$result = true;
if((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
$header .= $this->CreateHeader();
$body = $this->CreateBody();
- if($body == '') {
+ if($body == "") {
return false;
}
*/
function MailSend($header, $body) {
- $to = '';
+ $to = "";
for($i = 0; $i < count($this->to); $i++) {
if($i != 0) { $to .= ', '; }
$to .= $this->AddrFormat($this->to[$i]);
*/
function SmtpSend($header, $body) {
include_once($this->PluginDir . 'class.smtp.php');
- $error = '';
+ $error = "";
$bad_rcpt = array();
if(!$this->SmtpConnect()) {
return false;
}
- $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
+ $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender;
if(!$this->smtp->Mail($smtp_from)) {
$error = $this->Lang('from_failed') . $smtp_from;
$this->SetError($error);
$port = $this->Port;
}
- if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':'').$host, $port, $this->Timeout)) {
+ if($this->smtp->Connect(((!empty($this->SMTPSecure))?$this->SMTPSecure.'://':"").$host, $port, $this->Timeout)) {
if ($this->Helo != '') {
$this->smtp->Hello($this->Helo);
} else {
}
$line = explode($this->LE, $message);
- $message = '';
+ $message = "";
for ($i=0 ;$i < count($line); $i++) {
$line_part = explode(' ', $line[$i]);
- $buf = '';
+ $buf = "";
for ($e = 0; $e<count($line_part); $e++) {
$word = $line_part[$e];
if ($qp_mode and (strlen($word) > $length)) {
} else {
$message .= $buf . $soft_break;
}
- $buf = '';
+ $buf = "";
}
while (strlen($word) > 0) {
$len = $length;
* @return string
*/
function CreateHeader() {
- $result = '';
+ $result = "";
/* Set the boundaries */
$uniq_id = md5(uniqid(time()));
$this->boundary[2] = 'b2_' . $uniq_id;
$result .= $this->HeaderLine('Date', $this->RFCDate());
- if($this->Sender == '') {
+ if($this->Sender == "") {
$result .= $this->HeaderLine('Return-Path', trim($this->From));
} else {
$result .= $this->HeaderLine('Return-Path', trim($this->Sender));
* @return string
*/
function CreateBody() {
- $result = '';
+ $result = "";
$this->SetWordWrap();
switch($this->message_type) {
case 'alt':
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/plain', '');
+ $result .= $this->GetBoundary($this->boundary[1], "", 'text/plain', "");
$result .= $this->EncodeString($this->AltBody, $this->Encoding);
$result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[1], '', 'text/html', '');
+ $result .= $this->GetBoundary($this->boundary[1], "", 'text/html', "");
$result .= $this->EncodeString($this->Body, $this->Encoding);
$result .= $this->LE.$this->LE;
$result .= $this->EndBoundary($this->boundary[1]);
$result .= $this->EncodeString($this->Body, $this->Encoding);
break;
case 'attachments':
- $result .= $this->GetBoundary($this->boundary[1], '', '', '');
+ $result .= $this->GetBoundary($this->boundary[1], "", "", "");
$result .= $this->EncodeString($this->Body, $this->Encoding);
$result .= $this->LE;
$result .= $this->AttachAll();
case 'alt_attachments':
$result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
$result .= sprintf("Content-Type: %s;%s" . "\tboundary=\"%s\"%s", 'multipart/alternative', $this->LE, $this->boundary[2], $this->LE.$this->LE);
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/plain', '') . $this->LE; // Create text body
+ $result .= $this->GetBoundary($this->boundary[2], "", 'text/plain', "") . $this->LE; // Create text body
$result .= $this->EncodeString($this->AltBody, $this->Encoding);
$result .= $this->LE.$this->LE;
- $result .= $this->GetBoundary($this->boundary[2], '', 'text/html', '') . $this->LE; // Create the HTML body
+ $result .= $this->GetBoundary($this->boundary[2], "", 'text/html', "") . $this->LE; // Create the HTML body
$result .= $this->EncodeString($this->Body, $this->Encoding);
$result .= $this->LE.$this->LE;
$result .= $this->EndBoundary($this->boundary[2]);
break;
}
if($this->IsError()) {
- $result = '';
+ $result = "";
}
return $result;
* @access private
*/
function GetBoundary($boundary, $charSet, $contentType, $encoding) {
- $result = '';
- if($charSet == '') {
+ $result = "";
+ if($charSet == "") {
$charSet = $this->CharSet;
}
- if($contentType == '') {
+ if($contentType == "") {
$contentType = $this->ContentType;
}
- if($encoding == '') {
+ if($encoding == "") {
$encoding = $this->Encoding;
}
$result .= $this->TextLine('--' . $boundary);
* @param string $type File extension (MIME) type.
* @return bool
*/
- function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+ function AddAttachment($path, $name = "", $encoding = 'base64', $type = 'application/octet-stream') {
if(!@is_file($path)) {
$this->SetError($this->Lang('file_access') . $path);
return false;
}
$filename = basename($path);
- if($name == '') {
+ if($name == "") {
$name = $filename;
}
if($bString) {
$mime[] = $this->EncodeString($string, $encoding);
if($this->IsError()) {
- return '';
+ return "";
}
$mime[] = $this->LE.$this->LE;
} else {
$mime[] = $this->EncodeFile($path, $encoding);
if($this->IsError()) {
- return '';
+ return "";
}
$mime[] = $this->LE.$this->LE;
}
$mime[] = sprintf("--%s--%s", $this->boundary[1], $this->LE);
- return join('', $mime);
+ return join("", $mime);
}
/**
function EncodeFile ($path, $encoding = 'base64') {
if(!@$fd = fopen($path, 'rb')) {
$this->SetError($this->Lang('file_open') . $path);
- return '';
+ return "";
}
$magic_quotes = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
* @return string
*/
function EncodeString ($str, $encoding = 'base64') {
- $encoded = '';
+ $encoded = "";
switch(strtolower($encoding)) {
case 'base64':
/* chunk_split is found in PHP >= 3.0.6 */
* @access private
* @return string
*/
- function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
+ function EncodeQP( $input = "", $line_max = 76, $space_conv = false ) {
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
$lines = preg_split('/(?:\r\n|\r|\n)/', $input);
$eol = "\r\n";
$escape = '=';
- $output = '';
+ $output = "";
while( list(, $line) = each($lines) ) {
$linlen = strlen($line);
- $newline = '';
+ $newline = "";
for($i = 0; $i < $linlen; $i++) {
$c = substr( $line, $i, 1 );
$dec = ord( $c );
}
if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
$output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay
- $newline = '';
+ $newline = "";
// check if newline first character will be point or not
if ( $dec == 46 ) {
$c = '=2E';
*/
function EncodeQ ($str, $position = 'text') {
/* There should not be any EOL in the string */
- $encoded = preg_replace("[\r\n]", '', $str);
+ $encoded = preg_replace("[\r\n]", "", $str);
switch (strtolower($position)) {
case 'phrase':
* @param string $type File extension (MIME) type.
* @return bool
*/
- function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
+ function AddEmbeddedImage($path, $cid, $name = "", $encoding = 'base64', $type = 'application/octet-stream') {
if(!@is_file($path)) {
$this->SetError($this->Lang('file_access') . $path);
}
$filename = basename($path);
- if($name == '') {
+ if($name == "") {
$name = $filename;
}
if(isset($_SERVER[$varName])) {
return $_SERVER[$varName];
} else {
- return '';
+ return "";
}
}
* @access private
* @return mime type of ext
*/
- function _mime_types($ext = '') {
+ function _mime_types($ext = "") {
$mimes = array(
'hqx' => 'application/mac-binhex40',
'cpt' => 'application/mac-compactpro',
* @param mixed $value Parameter Value
* NOTE: will not work with arrays, there are no arrays to set/reset
*/
- function set ( $name, $value = '' ) {
+ function set ( $name, $value = "" ) {
if ( isset($this->$name) ) {
$this->$name = $value;
} else {
* @param string $filename Parameter File Name
*/
function getFile($filename) {
- $return = '';
+ $return = "";
if ($fp = fopen($filename, 'rb')) {
while (!feof($fp)) {
$return .= fread($fp, 1024);