diff --git a/examples/mailing_list.phps b/examples/mailing_list.phps
index a3aa9d4d..9eb05d63 100644
--- a/examples/mailing_list.phps
+++ b/examples/mailing_list.phps
@@ -51,7 +51,10 @@ foreach ($result as $row) {
try {
$mail->addAddress($row['email'], $row['full_name']);
} catch (Exception $e) {
- echo 'Invalid address skipped: ' . htmlspecialchars($row['email']) . '
';
+ printf(
+ 'Invalid address skipped: %s
',
+ htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
+ );
continue;
}
if (!empty($row['photo'])) {
@@ -66,8 +69,11 @@ foreach ($result as $row) {
try {
$mail->send();
- echo 'Message sent to :' . htmlspecialchars($row['full_name']) . ' (' .
- htmlspecialchars($row['email']) . ')
';
+ printf(
+ 'Message sent to : %s (%s)
',
+ htmlspecialchars($row['full_name'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401),
+ htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401)
+ );
//Mark it as sent in the DB
mysqli_query(
$mysql,
@@ -75,7 +81,11 @@ foreach ($result as $row) {
mysqli_real_escape_string($mysql, $row['email']) . "'"
);
} catch (Exception $e) {
- echo 'Mailer Error (' . htmlspecialchars($row['email']) . ') ' . $mail->ErrorInfo . '
';
+ printf(
+ 'Mailer Error (%s) %s
',
+ htmlspecialchars($row['email'], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401),
+ $mail->ErrorInfo
+ );
//Reset the connection to abort sending this message
//The loop will continue trying to send to the rest of the list
$mail->getSMTPInstance()->reset();
diff --git a/examples/send_file_upload.phps b/examples/send_file_upload.phps
index 31d22837..8c6ec070 100644
--- a/examples/send_file_upload.phps
+++ b/examples/send_file_upload.phps
@@ -54,7 +54,7 @@ if (array_key_exists('userfile', $_FILES)) {