A boatload of changes!

New exception handling
Improved language string loading to avoid errors
Simplified language files
Lots of code cleanup
Changed some function access
This commit is contained in:
Marcus Bointon 2009-03-28 02:13:01 +00:00
parent 57cec81eec
commit f7fbc16a6b
34 changed files with 1337 additions and 1356 deletions

View File

@ -2,10 +2,11 @@ ChangeLog
NOTE: THIS VERSION OF PHPMAILER IS DESIGNED FOR PHP5/PHP6. IT WILL NOT WORK WITH PHP4.
Version ??
* replaced deprecated split()
* fixed image file extension checking to retrieve last part of explode() file name
* added code to check for duplicate image filename to eliminate multiple same-name images
Version 5.0.0 (March xx, 2009)
* With the release of this version, we are initiating a new version numbering
system to differentiate from the PHP4 version of PHPMailer.
* Most notable in this release is fully object oriented code.
Version 2.3 (November 06, 2008)

7
README
View File

@ -9,6 +9,13 @@ PHPMailer
Full Featured Email Transfer Class for PHP
==========================================
Version 5.0.0 (March xx, 2009)
With the release of this version, we are initiating a new version numbering
system to differentiate from the PHP4 version of PHPMailer.
Most notable in this release is fully object oriented code.
Version 2.3 (November 08, 2008)
We have removed the /phpdoc from the downloads. All documentation is now on

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
/*~ class.pop3.php
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 2.3 |
| Version: 5.0.0 |
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
| Info: http://phpmailer.sourceforge.net |
| Support: http://sourceforge.net/projects/phpmailer/ |
@ -23,21 +23,10 @@
| - Technology Consulting |
| - Oursourcing (highly qualified programmers and graphic designers) |
'---------------------------------------------------------------------------'
*/
/**
* PHPMailer - PHP POP Before SMTP Authentication Class
* NOTE: Designed for use with PHP version 5 and up
* @package PHPMailer
* @author Andy Prevost
* @copyright 2004 - 2008 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
* @version $Id$
*/
/**
* POP Before SMTP Authentication Class
* Version 2.3
* Version 5.0.0
*
* Author: Richard Davey (rich@corephp.co.uk)
* Modifications: Andy Prevost

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,10 @@
<?php
/**
* PHPMailer language file.
* Arabic Version, UTF-8
* by : bahjat al mostafa <bahjat983@hotmail.com>
*/
* PHPMailer language file: refer to English translation for definitive list
* Arabic Version, UTF-8
* by : bahjat al mostafa <bahjat983@hotmail.com>
*/
$PHPMAILER_LANG = array();
$PHPMAILER_LANG['provide_address'] = 'You must provide at least one ' .
'recipient email address.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer غير مدعوم.';
$PHPMAILER_LANG['execute'] = 'لم أستطع تنفيذ : ';
$PHPMAILER_LANG['instantiate'] = 'لم نستطع توفير خدمة البريد.';
@ -22,5 +18,4 @@ $PHPMAILER_LANG['file_access'] = 'لم نستطع الوصول للملف: ';
$PHPMAILER_LANG['file_open'] = 'File Error: لم نستطع فتح الملف: ';
$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: ';
$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,10 @@
<?php
/**
* PHPMailer language file.
* Portuguese Version
* By Paulo Henrique Garcia - paulo@controllerweb.com.br
*/
* PHPMailer language file: refer to English translation for definitive list
* Portuguese Version
* By Paulo Henrique Garcia - paulo@controllerweb.com.br
*/
$PHPMAILER_LANG = array();
$PHPMAILER_LANG['provide_address'] = 'Você deve fornecer pelo menos um endereço de destinatário de email.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não suportado.';
$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
@ -18,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível cone
$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,9 @@
<?php
/**
* PHPMailer language file.
* Catalan Version
* By Ivan: web AT microstudi DOT com
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Catalan Version
* By Ivan: web AT microstudi DOT com
*/
$PHPMAILER_LANG['provide_address'] = 'S\'ha de proveir almenys una adreça d\'email com a destinatari.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
@ -19,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al se
$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l\'arxiu: ';
$PHPMAILER_LANG['file_open'] = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,9 @@
<?php
/**
* PHPMailer language file.
* Chinese Version
* By LiuXin: www.80x86.cn/blog/
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Chinese Version
* By LiuXin: www.80x86.cn/blog/
*/
$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。';
$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。';
@ -19,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP 错误: 不能连接SMTP主机。';
$PHPMAILER_LANG['file_access'] = '不能访问文件:';
$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:';
$PHPMAILER_LANG['encoding'] = '未知编码:';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,23 +1,19 @@
<?php
/**
* PHPMailer language file.
* Czech Version
*/
* PHPMailer language file: refer to English translation for definitive list
* Czech Version
*/
$PHPMAILER_LANG = array();
$PHPMAILER_LANG["provide_address"] = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.';
$PHPMAILER_LANG["mailer_not_supported"] = ' mailový klient není podporován.';
$PHPMAILER_LANG["execute"] = 'Nelze provést: ';
$PHPMAILER_LANG["instantiate"] = 'Nelze vytvoøit instanci emailové funkce.';
$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Chyba autentikace.';
$PHPMAILER_LANG["from_failed"] = 'Následující adresa From je nesprávná: ';
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: Adresy pøíjemcù nejsou správné ' .
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data nebyla pøijata';
$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Nelze navázat spojení se SMTP serverem.';
$PHPMAILER_LANG["file_access"] = 'Soubor nenalezen: ';
$PHPMAILER_LANG["file_open"] = 'File Error: Nelze otevøít soubor pro ètení: ';
$PHPMAILER_LANG["encoding"] = 'Neznámé kódování: ';
$PHPMAILER_LANG["signing"] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
$PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoò jednu emailovou adresu pøíjemce.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailový klient není podporován.';
$PHPMAILER_LANG['execute'] = 'Nelze provést: ';
$PHPMAILER_LANG['instantiate'] = 'Nelze vytvoøit instanci emailové funkce.';
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentikace.';
$PHPMAILER_LANG['from_failed'] = 'Následující adresa From je nesprávná: ';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy pøíjemcù nejsou správné ' .
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data nebyla pøijata';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nelze navázat spojení se SMTP serverem.';
$PHPMAILER_LANG['file_access'] = 'Soubor nenalezen: ';
$PHPMAILER_LANG['file_open'] = 'File Error: Nelze otevøít soubor pro ètení: ';
$PHPMAILER_LANG['encoding'] = 'Neznámé kódování: ';
?>

View File

@ -1,11 +1,9 @@
<?php
/**
* PHPMailer language file.
* German Version
* Thanks to Yann-Patrick Schlame for the latest update!
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* German Version
* Thanks to Yann-Patrick Schlame for the latest update!
*/
$PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfänger Emailadresse an.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.';
@ -20,5 +18,4 @@ $PHPMAILER_LANG['file_access'] = 'Zugriff auf folgende Datei fehlgeschl
$PHPMAILER_LANG['file_open'] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
$PHPMAILER_LANG['encoding'] = 'Unbekanntes Encoding-Format: ';
$PHPMAILER_LANG['signing'] = 'Fehler beim Signieren: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,9 @@
<?php
/**
* PHPMailer language file.
* Danish Version
* Author: Mikael Stokkebro <info@stokkebro.dk> */
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Danish Version
* Author: Mikael Stokkebro <info@stokkebro.dk>
*/
$PHPMAILER_LANG['provide_address'] = 'Du skal indtaste mindst en modtagers emailadresse.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
@ -18,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Kunne ikke tilslutte SMTP
$PHPMAILER_LANG['file_access'] = 'Ingen adgang til fil: ';
$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,8 @@
<?php
/**
* PHPMailer language file.
* English Version
*/
$PHPMAILER_LANG = array();
* PHPMailer language file.
* English Version
*/
$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer is not supported.';
@ -20,4 +18,6 @@ $PHPMAILER_LANG['file_open'] = 'File Error: Could not open file: ';
$PHPMAILER_LANG['encoding'] = 'Unknown encoding: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
$PHPMAILER_LANG['empty_message'] = 'Message body empty';
$PHPMAILER_LANG['invalid_address'] = 'Invalid address';
?>

View File

@ -1,10 +1,9 @@
<?php
/**
* PHPMailer language file.
* Versión en español
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Spanish version
* Versión en español
*/
$PHPMAILER_LANG['provide_address'] = 'Debe proveer al menos una dirección de email como destinatario.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
@ -19,5 +18,4 @@ $PHPMAILER_LANG['file_access'] = 'No puedo acceder al archivo: ';
$PHPMAILER_LANG['file_open'] = 'Error de Archivo: No puede abrir el archivo: ';
$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,9 @@
<?php
/**
* PHPMailer language file.
* Estonian Version
* By Indrek Päri
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Estonian Version
* By Indrek Päri
*/
$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
@ -19,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühend
$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: ';
$PHPMAILER_LANG['encoding'] = 'Tundmatu Unknown kodeering: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,9 @@
<?php
/**
* PHPMailer language file.
* Finnish Version
* By Jyry Kuukanen
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Finnish Version
* By Jyry Kuukanen
*/
$PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.';
$PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.';
@ -19,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP-virhe: yhteys palvelimeen ei onn
$PHPMAILER_LANG['file_access'] = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
$PHPMAILER_LANG['file_open'] = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,12 +1,10 @@
<?php
/**
* PHPMailer language file.
* Faroese Version [language of the Faroe Islands, a Danish dominion]
* This file created: 11-06-2004
* Supplied by Dávur Sørensen [www.profo-webdesign.dk]
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Faroese Version [language of the Faroe Islands, a Danish dominion]
* This file created: 11-06-2004
* Supplied by Dávur Sørensen [www.profo-webdesign.dk]
*/
$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
@ -20,6 +18,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samban
$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: ';
$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: ';
$PHPMAILER_LANG['encoding'] = 'Ókend encoding: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,8 @@
<?php
/**
* PHPMailer language file.
* French Version
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* French Version
*/
$PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.';
$PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.';
@ -18,6 +16,4 @@ $PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : Impossible de se connec
$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : ';
$PHPMAILER_LANG['file_open'] = 'Erreur Fichier : ouverture impossible : ';
$PHPMAILER_LANG['encoding'] = 'Encodage inconnu : ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,8 @@
<?php
/**
* PHPMailer language file.
* Hungarian Version
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Hungarian Version
*/
$PHPMAILER_LANG['provide_address'] = 'Meg kell adnod legalább egy címzett email címet.';
$PHPMAILER_LANG['mailer_not_supported'] = ' levelezõ nem támogatott.';
@ -18,6 +16,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP Hiba: Nem tudtam csatlakozni az
$PHPMAILER_LANG['file_access'] = 'Nem sikerült elérni a következõ fájlt: ';
$PHPMAILER_LANG['file_open'] = 'Fájl Hiba: Nem sikerült megnyitni a következõ fájlt: ';
$PHPMAILER_LANG['encoding'] = 'Ismeretlen kódolás: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,10 @@
<?php
/**
* PHPMailer language file.
* PHPMailer language file: refer to English translation for definitive list
* Italian version
* @package PHPMailer
* @author Ilias Bartolini <brain79@inwind.it>*/
$PHPMAILER_LANG = array();
* @author Ilias Bartolini <brain79@inwind.it>
*/
$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente';
$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
@ -21,6 +20,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi a
$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: ';
$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: ';
$PHPMAILER_LANG['encoding'] = 'Encoding set dei caratteri sconosciuto: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,9 @@
<?php
/**
* PHPMailer language file.
* Japanese Version
* By Mitsuhiro Yoshida - http://mitstek.com/
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Japanese Version
* By Mitsuhiro Yoshida - http://mitstek.com/
*/
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
@ -19,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続でき
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,8 @@
<?php
/**
* PHPMailer language file.
* Dutch Version
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Dutch Version
*/
$PHPMAILER_LANG['provide_address'] = 'Er moet tenmiste één ontvanger emailadres opgegeven worden.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
@ -18,6 +16,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP Fout: Kon niet verbinden met SMT
$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
$PHPMAILER_LANG['file_open'] = 'Bestandsfout: Kon bestand niet openen: ';
$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,8 @@
<?php
/**
* PHPMailer language file.
* Norwegian Version
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Norwegian Version
*/
$PHPMAILER_LANG['provide_address'] = 'Du må ha med minst en mottager adresse.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer er ikke supportert.';
@ -18,6 +16,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP
$PHPMAILER_LANG['file_access'] = 'Kunne ikke få tilgang til filen: ';
$PHPMAILER_LANG['file_open'] = 'Fil feil: Kunne ikke åpne filen: ';
$PHPMAILER_LANG['encoding'] = 'Ukjent encoding: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,8 @@
<?php
/**
* PHPMailer language file.
* Polish Version
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Polish Version
*/
$PHPMAILER_LANG["provide_address"] = 'Należy podać prawidłowy adres email Odbiorcy.';
$PHPMAILER_LANG["mailer_not_supported"] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.';
@ -18,6 +16,4 @@ $PHPMAILER_LANG["connect_host"] = 'Błąd SMTP: Nie można połączyć się z wy
$PHPMAILER_LANG["file_access"] = 'Brak dostępu do pliku: ';
$PHPMAILER_LANG["file_open"] = 'Nie można otworzyć pliku: ';
$PHPMAILER_LANG["encoding"] = 'Nieznany sposób kodowania znaków: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,10 @@
<?php
/**
* PHPMailer language file.
* Romanian Version
* @package PHPMailer
* @author Catalin Constantin <catalin@dazoot.ro> */
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Romanian Version
* @package PHPMailer
* @author Catalin Constantin <catalin@dazoot.ro>
*/
$PHPMAILER_LANG['provide_address'] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.';
@ -19,6 +18,4 @@ $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Nu m-am putut conecta la
$PHPMAILER_LANG['file_access'] = 'Nu pot accesa fisierul: ';
$PHPMAILER_LANG['file_open'] = 'Eroare de fisier: Nu pot deschide fisierul: ';
$PHPMAILER_LANG['encoding'] = 'Encodare necunoscuta: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,9 +1,8 @@
<?php
/**
* PHPMailer language file.
* Russian Version by Alexey Chumakov <alex@chumakov.ru> */
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Russian Version by Alexey Chumakov <alex@chumakov.ru>
*/
$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один адрес e-mail получателя.';
$PHPMAILER_LANG['mailer_not_supported'] = ' - почтовый сервер не поддерживается.';
@ -18,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удаетс
$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удается открыть файл: ';
$PHPMAILER_LANG['encoding'] = 'Неизвестный вид кодировки: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,10 +1,9 @@
<?php
/**
* PHPMailer language file.
* Swedish Version
* Author: Johan Linnér <johan@linner.biz> */
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Swedish Version
* Author: Johan Linnér <johan@linner.biz>
*/
$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
@ -18,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMT
$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,10 @@
<?php
/**
* PHPMailer dil dosyasý.
* Türkçe Versiyonu
* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
*/
$PHPMAILER_LANG = array();
* PHPMailer language file: refer to English translation for definitive list
* Turkish version
* Türkçe Versiyonu
* ÝZYAZILIM - Elçin Özel - Can Yýlmaz - Mehmet Benlioðlu
*/
$PHPMAILER_LANG['provide_address'] = 'En az bir tane mail adresi belirtmek zorundasýnýz alýcýnýn email adresi.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailler desteklenmemektedir.';
@ -19,6 +18,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP Hatasý: SMTP hosta baðlanýlam
$PHPMAILER_LANG['file_access'] = 'Dosyaya eriþilemiyor: ';
$PHPMAILER_LANG['file_open'] = 'Dosya Hatasý: Dosya açýlamýyor: ';
$PHPMAILER_LANG['encoding'] = 'Bilinmeyen þifreleme: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,11 +1,10 @@
<?php
/**
* PHPMailer language file.
* Traditional Chinese Version
* @author liqwei <liqwei@liqwei.com>
*/
* PHPMailer language file: refer to English translation for definitive list
* Traditional Chinese Version
* @author liqwei <liqwei@liqwei.com>
*/
$PHPMAILER_LANG = array();
$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。';
$PHPMAILER_LANG['mailer_not_supported'] = '發信客戶端不被支持。';
$PHPMAILER_LANG['execute'] = '無法執行:';
@ -18,6 +17,4 @@ $PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連接到 SMTP 主機。'
$PHPMAILER_LANG['file_access'] = '無法訪問文件:';
$PHPMAILER_LANG['file_open'] = '文件錯誤:無法打開文件:';
$PHPMAILER_LANG['encoding'] = '未知編碼: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
?>

View File

@ -1,24 +1,20 @@
<?php
/**
* PHPMailer language file.
* Simplified Chinese Version
* @author liqwei <liqwei@liqwei.com>
*/
* PHPMailer language file: refer to English translation for definitive list
* Simplified Chinese Version
* @author liqwei <liqwei@liqwei.com>
*/
$PHPMAILER_LANG = array();
$PHPMAILER_LANG["provide_address"] = '必须提供至少一个收件人地址。';
$PHPMAILER_LANG["mailer_not_supported"] = '发信客户端不被支持。';
$PHPMAILER_LANG["execute"] = '无法执行:';
$PHPMAILER_LANG["instantiate"] = '未知函数调用。';
$PHPMAILER_LANG["authenticate"] = 'SMTP 错误:登录失败。';
$PHPMAILER_LANG["from_failed"] = '发送地址错误:';
$PHPMAILER_LANG["recipients_failed"] = 'SMTP 错误:收件人地址错误:';
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP 错误:数据不被接受。';
$PHPMAILER_LANG["connect_host"] = 'SMTP 错误:无法连接到 SMTP 主机。';
$PHPMAILER_LANG["file_access"] = '无法访问文件:';
$PHPMAILER_LANG["file_open"] = '文件错误:无法打开文件:';
$PHPMAILER_LANG["encoding"] = '未知编码: ';
$PHPMAILER_LANG["signing"] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
$PHPMAILER_LANG['execute'] = '无法执行:';
$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
$PHPMAILER_LANG['file_access'] = '无法访问文件:';
$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
$PHPMAILER_LANG['encoding'] = '未知编码: ';
?>

10
test/contents.html Normal file
View File

@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Email test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Here is a test HTML email</p>
</body>
</html>

View File

@ -1,18 +1,24 @@
<?php
/*******************
Unit Test
Type: phpmailer class
********************/
/**
* PHPMailer - PHP email transport unit tests
* @package PHPMailer
* @author Andy Prevost
* @author Marcus Bointon
* @copyright 2004 - 2009 Andy Prevost
* @version $Id$
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
*/
$INCLUDE_DIR = "../";
require("phpunit.php");
require($INCLUDE_DIR . "class.phpmailer.php");
require 'phpunit.php';
require $INCLUDE_DIR . 'class.phpmailer.php';
error_reporting(E_ALL);
/**
* Performs authentication tests
*/
* PHPMailer - PHP email transport unit test class
* Performs authentication tests
*/
class phpmailerTest extends TestCase
{
/**
@ -134,7 +140,7 @@ class phpmailerTest extends TestCase
$ReportBody .= "---------------------" . $eol;
$ReportBody .= "Unit Test Information" . $eol;
$ReportBody .= "---------------------" . $eol;
$ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;
$ReportBody .= "phpmailer version: " . PHPMailer::VERSION . $eol;
$ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
if(strlen($this->Mail->Host) > 0)
@ -146,11 +152,10 @@ class phpmailerTest extends TestCase
{
$ReportBody .= "Attachments:" . $eol;
$ReportBody .= $bullet_start;
for($i = 0; $i < count($attachments); $i++)
{
$ReportBody .= $bullet . "Name: " . $attachments[$i][1] . ", ";
$ReportBody .= "Encoding: " . $attachments[$i][3] . ", ";
$ReportBody .= "Type: " . $attachments[$i][4] . $eol;
foreach($attachments as $attachment) {
$ReportBody .= $bullet . "Name: " . $attachment[1] . ", ";
$ReportBody .= "Encoding: " . $attachment[3] . ", ";
$ReportBody .= "Type: " . $attachment[4] . $eol;
}
$ReportBody .= $bullet_end . $eol;
}
@ -243,11 +248,14 @@ class phpmailerTest extends TestCase
switch($sType)
{
case "to":
return $this->Mail->AddAddress($sAddress, $sName);
$this->Mail->AddAddress($sAddress, $sName);
break;
case "cc":
return $this->Mail->AddCC($sAddress, $sName);
$this->Mail->AddCC($sAddress, $sName);
break;
case "bcc":
return $this->Mail->AddBCC($sAddress, $sName);
$this->Mail->AddBCC($sAddress, $sName);
break;
}
}
@ -463,11 +471,8 @@ class phpmailerTest extends TestCase
$this->BuildBody();
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
if (is_writable('.')) {
file_put_contents('message.txt', $this->Mail->CreateHeader() . $this->Mail->CreateBody());
} else {
$this->assert(false, 'Could not write local file - check permissions');
}
file_put_contents('message.txt', $this->Mail->CreateHeader() . $this->Mail->CreateBody());
}
function test_MultipleSend() {
@ -515,73 +520,35 @@ class phpmailerTest extends TestCase
$this->assert($this->Mail->IsError() == false, "Error found");
$this->assert($this->Mail->Send() == false, "Send succeeded");
$this->assert($this->Mail->IsError(), "No error found");
//Note that this is language dependent
$this->assertEquals('You must provide at least one recipient email address.', $this->Mail->ErrorInfo);
$this->Mail->AddAddress(get("mail_to"));
$this->assert($this->Mail->Send(), "Send failed");
}
function test_Addressing() {
$this->assert($this->Mail->AddAddress('a@example.com'), 'Addressing failed');
$this->assert(!$this->Mail->AddAddress('a@example.com'), 'Duplicate addressing failed');
$this->assert($this->Mail->AddCC('b@example.com'), 'CC addressing failed');
$this->assert(!$this->Mail->AddCC('b@example.com'), 'CC duplicate Addressing failed');
$this->assert(!$this->Mail->AddCC('a@example.com'), 'CC duplicate Addressing failed (2)');
$this->assert($this->Mail->AddBCC('c@example.com'), 'BCC addressing failed');
$this->assert(!$this->Mail->AddBCC('c@example.com'), 'BCC duplicate addressing failed');
$this->assert(!$this->Mail->AddBCC('a@example.com'), 'BCC duplicate Addressing failed (2)');
$this->Mail->ClearAddresses();
$this->assert($this->Mail->AddAddress('a@example.com'), 'Addressing after clear failed');
$this->Mail->ClearCCs();
$this->assert($this->Mail->AddAddress('b@example.com'), 'CC addressing after clear failed');
$this->Mail->ClearBCCs();
$this->assert($this->Mail->AddAddress('c@example.com'), 'BCC addressing after clear failed');
$this->Mail->AddAddress('a@example.com');
$this->Mail->AddCC('b@example.com');
$this->Mail->AddBCC('c@example.com');
$this->Mail->ClearAllRecipients(); //Not much of a test, but helps coverage
}
// Check that we are not missing any translations in any langauges
function test_Translations() {
//Extend this array as new strings are added
$expectedtranslations = array(
'provide_address',
'mailer_not_supported',
'execute',
'instantiate',
'authenticate',
'from_failed',
'recipients_failed',
'data_not_accepted',
'connect_host',
'file_access',
'file_open',
'encoding',
'signing',
'smtp_error'
);
try {
foreach (new DirectoryIterator('../language') as $langfile) {
if (!preg_match('/^phpmailer\.lang-/', $langfile)) continue; //Skip non-language files
$PHPMAILER_LANG = array();
include '../language/'.$langfile;
foreach($expectedtranslations as $string) {
$this->assert(isset($PHPMAILER_LANG[$string]), 'Translation missing; \''.$string.'\' in '.$langfile);
}
}
}
catch(Exception $e) {
$this->assert(false, 'No language files found!');
}
}
//Check that getFile works
function test_getFile() {
$a = $this->Mail->getFile('../class.phpmailer.php'); //Point at any non-empty file
$this->assert(($a !== false), 'GetFile failed to read a file.');
}
}
/**
* Test language files for missing and excess translations
* All languages are compared with English
*/
function test_Translations() {
$this->Mail->SetLanguage('en');
$definedStrings = $this->Mail->GetTranslations();
foreach (new DirectoryIterator('../language') as $fileInfo) {
if($fileInfo->isDot()) continue;
$matches = array();
//Only look at language files, ignore anything else in there
if (preg_match('/^phpmailer\.lang-([a-z_]{2,})\.php$/', $fileInfo->getFilename(), $matches)) {
$lang = $matches[1]; //Extract language code
$PHPMAILER_LANG = array(); //Language strings get put in here
include dirname(dirname(__FILE__)).'/language/'.$fileInfo->getFilename(); //Get language strings
$missing = array_diff(array_keys($definedStrings), array_keys($PHPMAILER_LANG));
$extra = array_diff(array_keys($PHPMAILER_LANG), array_keys($definedStrings));
$this->assert(empty($missing), "Missing translations in $lang: ". implode(', ', $missing));
$this->assert(empty($extra), "Extra translations in $lang: ". implode(', ', $extra));
}
}
}
}
/**
* Create and run test instance.
*/
@ -610,13 +577,8 @@ function get($sName) {
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>PHPMailer Unit Tests</title>
</head>
<body>
<h3>phpmailer Unit Test</h3>
By entering a SMTP hostname it will automatically perform tests with SMTP.

View File

@ -34,7 +34,7 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE |
/*
interface Test {
function run($aTestResult);
function run(&$aTestResult);
function countTestCases();
}
*/
@ -103,7 +103,7 @@ class TestCase extends Assert /* implements Test */ {
$this->fName = $name;
}
function run(&$testResult=0) {
function run($testResult=0) {
/* Run this single test, by calling the run() method of the
TestResult object which will in turn call the runBare() method
of this object. That complication allows the TestResult object
@ -223,7 +223,7 @@ class TestSuite /* implements Test */ {
$this->fTests[] = $test;
}
function run($testResult) {
function run(&$testResult) {
/* Run all TestCases and TestSuites comprising this TestSuite,
accumulating results in the given TestResult object. */
reset($this->fTests);
@ -352,14 +352,14 @@ class TextTestResult extends TestResult {
}
function _startTest($test) {
printf("%s: ", $test->name());
printf("%s ", $test->name());
flush();
}
function _endTest($test) {
$outcome = $test->failed()
? "<font color=\"red\">FAIL</font>"
: "<font color=\"green\">Pass</font>";
: "<font color=\"green\">ok</font>";
printf("$outcome<br>\n");
flush();
}

49
test/testemail.php Normal file
View File

@ -0,0 +1,49 @@
<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/
require '../class.phpmailer.php';
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$body = file_get_contents('contents.html');
$body = preg_replace('/\\\\/','', $body); //Strip backslashes
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->Username = "name@domain.com"; // SMTP server username
$mail->Password = "password"; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AddReplyTo("name@domain.com","First Last");
$mail->From = "name@domain.com";
$mail->FromName = "First Last";
$to = "someone@example...com";
$to = "marcus@bointon.com";
$mail->AddAddress($to);
$mail->Subject = "First PHPMailer Message";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true); // send as HTML
$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>