Skip to content

Commit 6ffa946

Browse files
committed
Tag 2.0.3 release
1 parent 769a5a4 commit 6ffa946

27 files changed

+289
-253
lines changed

ChangeLog.txt

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
ChangeLog
22

3+
Version 2.0.3 (November 08 2008)
4+
* fixed line 1041 in class.smtp.php (endless loop from missing = sign)
5+
* fixed duplicate images in email body
6+
* removed English language from language files and made it a default within
7+
class.phpmailer.php - if no language is found, it will default to use
8+
the english language translation
9+
* corrected $basedir to $directory
10+
* changed default of $LE to "\r\n" to comply with RFC 2822. Can be set by the user
11+
if default is not acceptable
12+
* removed trim() from return results in EncodeQP
13+
* changed $this->AltBody = $textMsg; to $this->AltBody = html_entity_decode($textMsg);
14+
* We have removed the /phpdoc from the downloads. All documentation is now on
15+
the http://phpmailer.codeworxtech.com website.
16+
317
Version 2.0.2 (June 04 2008)
418

519
** NOTE: WE HAVE A NEW LANGUAGE VARIABLE FOR DIGITALLY SIGNED S/MIME EMAILS.
@@ -8,9 +22,9 @@ Version 2.0.2 (June 04 2008)
822

923
* added S/MIME functionality (ability to digitally sign emails)
1024
BIG THANKS TO "sergiocambra" for posting this patch back in November 2007.
11-
The "Signed Emails" functionality adds the Sign method to pass the private key
12-
filename and the password to read it, and then email will be sent with
13-
content-type multipart/signed and with the digital signature attached.
25+
The "Signed Emails" functionality adds the Sign method to pass the private key
26+
filename and the password to read it, and then email will be sent with
27+
content-type multipart/signed and with the digital signature attached.
1428
* added ability to define path (mainly for embedded images)
1529
function MsgHTML($message,$basedir='') ... where:
1630
$basedir is the fully qualified path
@@ -90,11 +104,11 @@ Version 2.0.0 rc1 (Thu, Nov 08 2007), interim release
90104
* added TLS/SSL SMTP support
91105
example of use:
92106
$mail = new PHPMailer();
93-
$mail->Mailer = "smtp";
94-
$mail->Host = "smtp.example.com";
95-
$mail->SMTPSecure = "tls"; // option
96-
//$mail->SMTPSecure = "ssl"; // option
97-
...
107+
$mail->Mailer = "smtp";
108+
$mail->Host = "smtp.example.com";
109+
$mail->SMTPSecure = "tls"; // option
110+
//$mail->SMTPSecure = "ssl"; // option
111+
...
98112
$mail->Send();
99113
* PHPMailer has been tested with PHP4 (4.4.7) and PHP5 (5.2.7)
100114
* Works with PHP installed as a module or as CGI-PHP

README

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ PHPMailer
99
Full Featured Email Transfer Class for PHP
1010
==========================================
1111

12+
Version 2.3 (November 08, 2008)
13+
14+
PHP4 continues to be a major platform for developers. We are responding
15+
to the emails received to continue development for PHP4 with this
16+
release.
17+
18+
We have removed the /phpdoc from the downloads. All documentation is now on
19+
the http://phpmailer.codeworxtech.com website.
20+
21+
For all other changes and notes, please see the changelog.
22+
23+
Donations are accepted at PayPal with our id "paypal@worxteam.com".
24+
25+
Version 2.2 (July 15 2008)
26+
27+
- see the changelog.
28+
1229
Version 2.0.2 (June 04 2008)
1330

1431
With this release, we are announcing that the development of PHPMailer for PHP5
@@ -47,7 +64,7 @@ its leadership position. Our goals are to simplify use of PHPMailer, provide
4764
good documentation and examples, and retain backward compatibility to level
4865
1.7.3 standards.
4966

50-
If you are interested in helping out, visit http://sourceforge.net/phpmailer
67+
If you are interested in helping out, visit http://sourceforge.net/projects/phpmailer
5168
and indicate your interest.
5269

5370
**

class.phpmailer.php

Lines changed: 98 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*~ class.phpmailer.php
33
.---------------------------------------------------------------------------.
44
| Software: PHPMailer - PHP email class |
5-
| Version: 2.0.2 |
5+
| Version: 2.0.3 |
66
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
77
| Info: http://phpmailer.sourceforge.net |
88
| Support: http://sourceforge.net/projects/phpmailer/ |
@@ -139,7 +139,7 @@ class PHPMailer {
139139
* Holds PHPMailer version.
140140
* @var string
141141
*/
142-
var $Version = "2.0.2";
142+
var $Version = "2.0.3";
143143

144144
/**
145145
* Sets the email address that a reading confirmation will be sent.
@@ -256,7 +256,8 @@ class PHPMailer {
256256
var $boundary = array();
257257
var $language = array();
258258
var $error_count = 0;
259-
var $LE = "\n";
259+
var $LE = "\r\n";
260+
var $sign_cert_file = "";
260261
var $sign_key_file = "";
261262
var $sign_key_pass = "";
262263

@@ -649,8 +650,20 @@ function SetLanguage($lang_type, $lang_path = 'language/') {
649650
} elseif (file_exists($lang_path.'phpmailer.lang-en.php')) {
650651
include($lang_path.'phpmailer.lang-en.php');
651652
} else {
652-
$this->SetError('Could not load language file');
653-
return false;
653+
$PHPMAILER_LANG = array();
654+
$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
655+
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
656+
$PHPMAILER_LANG["execute"] = 'Could not execute: ';
657+
$PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
658+
$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
659+
$PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
660+
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
661+
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
662+
$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
663+
$PHPMAILER_LANG["file_access"] = 'Could not access file: ';
664+
$PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
665+
$PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
666+
$PHPMAILER_LANG["signing"] = 'Signing Error: ';
654667
}
655668
$this->language = $PHPMAILER_LANG;
656669

@@ -864,9 +877,6 @@ function CreateHeader() {
864877
} elseif (count($this->cc) == 0) {
865878
$result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
866879
}
867-
if(count($this->cc) > 0) {
868-
$result .= $this->AddrAppend('Cc', $this->cc);
869-
}
870880
}
871881

872882
$from = array();
@@ -1007,9 +1017,13 @@ function CreateBody() {
10071017
fclose($fp);
10081018
$signed = tempnam("", "signed");
10091019

1010-
if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_key_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
1020+
if (@openssl_pkcs7_sign($file, $signed, "file://".$this->sign_cert_file, array("file://".$this->sign_key_file, $this->sign_key_pass), null)) {
10111021
$fp = fopen($signed, "r");
10121022
$result = fread($fp, filesize($this->sign_key_file));
1023+
$result = '';
1024+
while(!feof($fp)){
1025+
$result = $result . fread($fp, 1024);
1026+
}
10131027
fclose($fp);
10141028
} else {
10151029
$this->SetError($this->Lang("signing").openssl_error_string());
@@ -1159,14 +1173,14 @@ function AttachAll() {
11591173
$cid = $this->attachment[$i][7];
11601174

11611175
$mime[] = sprintf("--%s%s", $this->boundary[1], $this->LE);
1162-
$mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
1176+
$mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $this->EncodeHeader($this->SecureHeader($name)), $this->LE);
11631177
$mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
11641178

11651179
if($disposition == 'inline') {
11661180
$mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
11671181
}
11681182

1169-
$mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $name, $this->LE.$this->LE);
1183+
$mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE.$this->LE);
11701184

11711185
/* Encode as string attachment */
11721186
if($bString) {
@@ -1399,7 +1413,7 @@ function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
13991413
} // end of for
14001414
$output .= $newline.$eol;
14011415
} // end of while
1402-
return trim($output);
1416+
return $output;
14031417
}
14041418

14051419
/**
@@ -1710,8 +1724,7 @@ function MsgHTML($message,$basedir='') {
17101724
$ext = $fileParts[1];
17111725
$mimeType = $this->_mime_types($ext);
17121726
if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }
1713-
if ( strlen($directory) > 1 && substr($basedir,-1) != '/') { $directory .= '/'; }
1714-
$this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType);
1727+
if ( strlen($directory) > 1 && substr($directory,-1) != '/') { $directory .= '/'; }
17151728
if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64',$mimeType) ) {
17161729
$message = preg_replace("/".$images[1][$i]."=\"".preg_quote($url, '/')."\"/Ui", $images[1][$i]."=\"".$cid."\"", $message);
17171730
}
@@ -1722,7 +1735,7 @@ function MsgHTML($message,$basedir='') {
17221735
$this->Body = $message;
17231736
$textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s','',$message)));
17241737
if ( !empty($textMsg) && empty($this->AltBody) ) {
1725-
$this->AltBody = $textMsg;
1738+
$this->AltBody = html_entity_decode($textMsg);
17261739
}
17271740
if ( empty($this->AltBody) ) {
17281741
$this->AltBody = 'To view this email message, open the email in with HTML compatibility!' . "\n\n";
@@ -1736,93 +1749,92 @@ function MsgHTML($message,$basedir='') {
17361749
*/
17371750
function _mime_types($ext = '') {
17381751
$mimes = array(
1739-
'hqx' => 'application/mac-binhex40',
1740-
'cpt' => 'application/mac-compactpro',
1741-
'doc' => 'application/msword',
1752+
'ai' => 'application/postscript',
1753+
'aif' => 'audio/x-aiff',
1754+
'aifc' => 'audio/x-aiff',
1755+
'aiff' => 'audio/x-aiff',
1756+
'avi' => 'video/x-msvideo',
17421757
'bin' => 'application/macbinary',
1743-
'dms' => 'application/octet-stream',
1744-
'lha' => 'application/octet-stream',
1745-
'lzh' => 'application/octet-stream',
1746-
'exe' => 'application/octet-stream',
1758+
'bmp' => 'image/bmp',
17471759
'class' => 'application/octet-stream',
1748-
'psd' => 'application/octet-stream',
1749-
'so' => 'application/octet-stream',
1750-
'sea' => 'application/octet-stream',
1751-
'dll' => 'application/octet-stream',
1752-
'oda' => 'application/oda',
1753-
'pdf' => 'application/pdf',
1754-
'ai' => 'application/postscript',
1755-
'eps' => 'application/postscript',
1756-
'ps' => 'application/postscript',
1757-
'smi' => 'application/smil',
1758-
'smil' => 'application/smil',
1759-
'mif' => 'application/vnd.mif',
1760-
'xls' => 'application/vnd.ms-excel',
1761-
'ppt' => 'application/vnd.ms-powerpoint',
1762-
'wbxml' => 'application/vnd.wap.wbxml',
1763-
'wmlc' => 'application/vnd.wap.wmlc',
1760+
'cpt' => 'application/mac-compactpro',
1761+
'css' => 'text/css',
17641762
'dcr' => 'application/x-director',
17651763
'dir' => 'application/x-director',
1766-
'dxr' => 'application/x-director',
1764+
'dll' => 'application/octet-stream',
1765+
'dms' => 'application/octet-stream',
1766+
'doc' => 'application/msword',
17671767
'dvi' => 'application/x-dvi',
1768+
'dxr' => 'application/x-director',
1769+
'eml' => 'message/rfc822',
1770+
'eps' => 'application/postscript',
1771+
'exe' => 'application/octet-stream',
1772+
'gif' => 'image/gif',
17681773
'gtar' => 'application/x-gtar',
1769-
'php' => 'application/x-httpd-php',
1770-
'php4' => 'application/x-httpd-php',
1771-
'php3' => 'application/x-httpd-php',
1772-
'phtml' => 'application/x-httpd-php',
1773-
'phps' => 'application/x-httpd-php-source',
1774+
'htm' => 'text/html',
1775+
'html' => 'text/html',
1776+
'jpe' => 'image/jpeg',
1777+
'jpeg' => 'image/jpeg',
1778+
'jpg' => 'image/jpeg',
1779+
'hqx' => 'application/mac-binhex40',
17741780
'js' => 'application/x-javascript',
1775-
'swf' => 'application/x-shockwave-flash',
1776-
'sit' => 'application/x-stuffit',
1777-
'tar' => 'application/x-tar',
1778-
'tgz' => 'application/x-tar',
1779-
'xhtml' => 'application/xhtml+xml',
1780-
'xht' => 'application/xhtml+xml',
1781-
'zip' => 'application/zip',
1781+
'lha' => 'application/octet-stream',
1782+
'log' => 'text/plain',
1783+
'lzh' => 'application/octet-stream',
17821784
'mid' => 'audio/midi',
17831785
'midi' => 'audio/midi',
1784-
'mpga' => 'audio/mpeg',
1786+
'mif' => 'application/vnd.mif',
1787+
'mov' => 'video/quicktime',
1788+
'movie' => 'video/x-sgi-movie',
17851789
'mp2' => 'audio/mpeg',
17861790
'mp3' => 'audio/mpeg',
1787-
'aif' => 'audio/x-aiff',
1788-
'aiff' => 'audio/x-aiff',
1789-
'aifc' => 'audio/x-aiff',
1791+
'mpe' => 'video/mpeg',
1792+
'mpeg' => 'video/mpeg',
1793+
'mpg' => 'video/mpeg',
1794+
'mpga' => 'audio/mpeg',
1795+
'oda' => 'application/oda',
1796+
'pdf' => 'application/pdf',
1797+
'php' => 'application/x-httpd-php',
1798+
'php3' => 'application/x-httpd-php',
1799+
'php4' => 'application/x-httpd-php',
1800+
'phps' => 'application/x-httpd-php-source',
1801+
'phtml' => 'application/x-httpd-php',
1802+
'png' => 'image/png',
1803+
'ppt' => 'application/vnd.ms-powerpoint',
1804+
'ps' => 'application/postscript',
1805+
'psd' => 'application/octet-stream',
1806+
'qt' => 'video/quicktime',
1807+
'ra' => 'audio/x-realaudio',
17901808
'ram' => 'audio/x-pn-realaudio',
17911809
'rm' => 'audio/x-pn-realaudio',
17921810
'rpm' => 'audio/x-pn-realaudio-plugin',
1793-
'ra' => 'audio/x-realaudio',
1811+
'rtf' => 'text/rtf',
1812+
'rtx' => 'text/richtext',
17941813
'rv' => 'video/vnd.rn-realvideo',
1795-
'wav' => 'audio/x-wav',
1796-
'bmp' => 'image/bmp',
1797-
'gif' => 'image/gif',
1798-
'jpeg' => 'image/jpeg',
1799-
'jpg' => 'image/jpeg',
1800-
'jpe' => 'image/jpeg',
1801-
'png' => 'image/png',
1802-
'tiff' => 'image/tiff',
1803-
'tif' => 'image/tiff',
1804-
'css' => 'text/css',
1805-
'html' => 'text/html',
1806-
'htm' => 'text/html',
1814+
'sea' => 'application/octet-stream',
18071815
'shtml' => 'text/html',
1808-
'txt' => 'text/plain',
1816+
'sit' => 'application/x-stuffit',
1817+
'so' => 'application/octet-stream',
1818+
'smi' => 'application/smil',
1819+
'smil' => 'application/smil',
1820+
'swf' => 'application/x-shockwave-flash',
1821+
'tar' => 'application/x-tar',
18091822
'text' => 'text/plain',
1810-
'log' => 'text/plain',
1811-
'rtx' => 'text/richtext',
1812-
'rtf' => 'text/rtf',
1813-
'xml' => 'text/xml',
1814-
'xsl' => 'text/xml',
1815-
'mpeg' => 'video/mpeg',
1816-
'mpg' => 'video/mpeg',
1817-
'mpe' => 'video/mpeg',
1818-
'qt' => 'video/quicktime',
1819-
'mov' => 'video/quicktime',
1820-
'avi' => 'video/x-msvideo',
1821-
'movie' => 'video/x-sgi-movie',
1822-
'doc' => 'application/msword',
1823+
'txt' => 'text/plain',
1824+
'tgz' => 'application/x-tar',
1825+
'tif' => 'image/tiff',
1826+
'tiff' => 'image/tiff',
1827+
'wav' => 'audio/x-wav',
1828+
'wbxml' => 'application/vnd.wap.wbxml',
1829+
'wmlc' => 'application/vnd.wap.wmlc',
18231830
'word' => 'application/msword',
1831+
'xht' => 'application/xhtml+xml',
1832+
'xhtml' => 'application/xhtml+xml',
18241833
'xl' => 'application/excel',
1825-
'eml' => 'message/rfc822'
1834+
'xls' => 'application/vnd.ms-excel',
1835+
'xml' => 'text/xml',
1836+
'xsl' => 'text/xml',
1837+
'zip' => 'application/zip'
18261838
);
18271839
return ( ! isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
18281840
}
@@ -1886,11 +1898,12 @@ function SecureHeader($str) {
18861898
* @param string $key_filename Parameter File Name
18871899
* @param string $key_pass Password for private key
18881900
*/
1889-
function Sign($key_filename, $key_pass) {
1901+
function Sign($cert_filename, $key_filename, $key_pass) {
1902+
$this->sign_cert_file = $cert_filename;
18901903
$this->sign_key_file = $key_filename;
18911904
$this->sign_key_pass = $key_pass;
18921905
}
18931906

18941907
}
18951908

1896-
?>
1909+
?>

class.pop3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*~ class.pop3.php
33
.---------------------------------------------------------------------------.
44
| Software: PHPMailer - PHP email class |
5-
| Version: 2.0.2 |
5+
| Version: 2.0.3 |
66
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
77
| Info: http://phpmailer.sourceforge.net |
88
| Support: http://sourceforge.net/projects/phpmailer/ |

0 commit comments

Comments
 (0)