diff --git a/SECURITY b/SECURITY.md similarity index 100% rename from SECURITY rename to SECURITY.md diff --git a/class.phpmailer.php b/class.phpmailer.php index 1136c9546..dabb68e99 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -1683,7 +1683,11 @@ public function setLanguage($langcode = 'en', $lang_path = '') { // Backwards compatibility for renamed language codes $renamed_langcodes = array( + 'br' => 'pt_br', + 'cz' => 'cs', 'dk' => 'da', + 'no' => 'nb', + 'se' => 'sv', ); if (isset($renamed_langcodes[$langcode])) { diff --git a/docs/Note_for_SMTP_debugging.md b/docs/Note_for_SMTP_debugging.md new file mode 100644 index 000000000..b89a7d159 --- /dev/null +++ b/docs/Note_for_SMTP_debugging.md @@ -0,0 +1,44 @@ +#SMTP Debugging + +If you are having problems connecting or sending emails through your SMTP server, the SMTP class can provide more information about the processing/errors taking place. +Use the debug functionality of the class to see what's going on in your connections. To do that, set the debug level in your script. For example: + +```php +$mail->SMTPDebug = 2; +$mail->isSMTP(); // tell the class to use SMTP +$mail->SMTPAuth = true; // enable SMTP authentication +$mail->Port = 25; // set the SMTP port +$mail->Host = "mail.yourhost.com"; // SMTP server +$mail->Username = "name@yourhost.com"; // SMTP account username +$mail->Password = "your password"; // SMTP account password +``` + +##Debug levels + +Setting the `SMTPDebug` property results in different amounts of output: + + * `0`: Disable debugging (you can also leave this out completely, 0 is the default). + * `1`: Output messages sent by the client. + * `2`: as 1, plus responses received from the server (this is probably the most useful setting for debugging). + * `3`: as 2, plus more information about the initial connection. + * `4`: as 3, plus even lower-level information, very verbose. + +You don't need to use levels above 2 unless you're having trouble connecting at all - it will just make output more verbose and more difficult to read. + +Note that you will get no output until you call `send()`, because no SMTP conversation takes place until you do that. + +##Debug output format + +The form that the debug output taks is determined by the `Debugoutput` property. This has several options: + + * `echo` Output plain-text as-is, appropriate for CLI + * `html` Output escaped, line breaks converted to `
`, appropriate for browser output + * `error_log` Output to error log as configured in php.ini + +By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise. Alternatively, you can implement your own system by providing a callable expecting two parameters: a message string and the debug level: + + $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; + +You can of course make this more complex - for example your could capture all the output and store it in a database. + +And finally, don't forget to disable debugging before going into production. diff --git a/docs/Note_for_SMTP_debugging.txt b/docs/Note_for_SMTP_debugging.txt deleted file mode 100644 index 128b2d9d8..000000000 --- a/docs/Note_for_SMTP_debugging.txt +++ /dev/null @@ -1,17 +0,0 @@ -If you are having problems connecting or sending emails through your SMTP server, the SMTP class can provide more information about the processing/errors taking place. -Use the debug functionality of the class to see what's going on in your connections. To do that, set the debug level in your script. For example: - -$mail->SMTPDebug = 1; -$mail->isSMTP(); // telling the class to use SMTP -$mail->SMTPAuth = true; // enable SMTP authentication -$mail->Port = 26; // set the SMTP port -$mail->Host = "mail.yourhost.com"; // SMTP server -$mail->Username = "name@yourhost.com"; // SMTP account username -$mail->Password = "your password"; // SMTP account password - -Notes on this: -$mail->SMTPDebug = 0; ... will disable debugging (you can also leave this out completely, 0 is the default) -$mail->SMTPDebug = 1; ... will echo errors and server responses -$mail->SMTPDebug = 2; ... will echo errors, server responses and client messages - -And finally, don't forget to disable debugging before going into production. diff --git a/language/phpmailer.lang-cz.php b/language/phpmailer.lang-cs.php similarity index 100% rename from language/phpmailer.lang-cz.php rename to language/phpmailer.lang-cs.php diff --git a/language/phpmailer.lang-no.php b/language/phpmailer.lang-nb.php similarity index 100% rename from language/phpmailer.lang-no.php rename to language/phpmailer.lang-nb.php diff --git a/language/phpmailer.lang-br.php b/language/phpmailer.lang-pt_br.php similarity index 100% rename from language/phpmailer.lang-br.php rename to language/phpmailer.lang-pt_br.php diff --git a/language/phpmailer.lang-se.php b/language/phpmailer.lang-sv.php similarity index 100% rename from language/phpmailer.lang-se.php rename to language/phpmailer.lang-sv.php