Version Description
- Removing the deprecation notice.
Download this release
Release Info
Developer | chmac |
Plugin | WP Mail SMTP by WPForms |
Version | 0.9.2 |
Comparing to | |
See all releases |
Code changes from version 0.9.1 to 0.9.2
- readme.txt +8 -2
- wp_mail_smtp.php +15 -34
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: chmac
|
|
3 |
Donate link: http://www.callum-macdonald.com/code/donate/
|
4 |
Tags: mail, smtp, wp_mail, mailer, phpmailer
|
5 |
Requires at least: 2.7
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 0.9.
|
8 |
|
9 |
Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings.
|
10 |
|
@@ -62,6 +62,9 @@ By all means please contact me to discuss features or options you'd like to see
|
|
62 |
|
63 |
== Changelog ==
|
64 |
|
|
|
|
|
|
|
65 |
= 0.9.1 =
|
66 |
* $phpmailer->language became protected in WP 3.2, no longer unset on debug output.
|
67 |
|
@@ -137,6 +140,9 @@ By all means please contact me to discuss features or options you'd like to see
|
|
137 |
|
138 |
== Upgrade Notice ==
|
139 |
|
|
|
|
|
|
|
140 |
= 0.9.1 =
|
141 |
Test mail functionality was broken on upgrade to 3.2, now restored.
|
142 |
|
3 |
Donate link: http://www.callum-macdonald.com/code/donate/
|
4 |
Tags: mail, smtp, wp_mail, mailer, phpmailer
|
5 |
Requires at least: 2.7
|
6 |
+
Tested up to: 3.7
|
7 |
+
Stable tag: 0.9.2
|
8 |
|
9 |
Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings.
|
10 |
|
62 |
|
63 |
== Changelog ==
|
64 |
|
65 |
+
= 0.9.2 =
|
66 |
+
* Removing the deprecation notice.
|
67 |
+
|
68 |
= 0.9.1 =
|
69 |
* $phpmailer->language became protected in WP 3.2, no longer unset on debug output.
|
70 |
|
140 |
|
141 |
== Upgrade Notice ==
|
142 |
|
143 |
+
= 0.9.2 =
|
144 |
+
Removing the deprecation notice.
|
145 |
+
|
146 |
= 0.9.1 =
|
147 |
Test mail functionality was broken on upgrade to 3.2, now restored.
|
148 |
|
wp_mail_smtp.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP-Mail-SMTP
|
4 |
-
Version: 0.9.
|
5 |
Plugin URI: http://www.callum-macdonald.com/code/wp-mail-smtp/
|
6 |
Description: Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings.
|
7 |
Author: Callum Macdonald
|
@@ -106,6 +106,7 @@ function phpmailer_init_smtp($phpmailer) {
|
|
106 |
}
|
107 |
|
108 |
// If you're using contstants, set any custom options here
|
|
|
109 |
|
110 |
}
|
111 |
else {
|
@@ -145,7 +146,7 @@ function phpmailer_init_smtp($phpmailer) {
|
|
145 |
|
146 |
// You can add your own options here, see the phpmailer documentation for more info:
|
147 |
// http://phpmailer.sourceforge.net/docs/
|
148 |
-
|
149 |
|
150 |
|
151 |
// STOP adding options here.
|
@@ -240,7 +241,7 @@ function wp_mail_smtp_options_page() {
|
|
240 |
<table class="optiontable form-table">
|
241 |
<tr valign="top">
|
242 |
<th scope="row"><?php _e('Mailer', 'wp_mail_smtp'); ?> </th>
|
243 |
-
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Mailer', 'wp_mail_smtp'); ?></legend>
|
244 |
<p><input id="mailer_smtp" type="radio" name="mailer" value="smtp" <?php checked('smtp', get_option('mailer')); ?> />
|
245 |
<label for="mailer_smtp"><?php _e('Send all WordPress emails via SMTP.', 'wp_mail_smtp'); ?></label></p>
|
246 |
<p><input id="mailer_mail" type="radio" name="mailer" value="mail" <?php checked('mail', get_option('mailer')); ?> />
|
@@ -311,7 +312,7 @@ function wp_mail_smtp_options_page() {
|
|
311 |
|
312 |
<h3><?php _e('Send a Test Email', 'wp_mail_smtp'); ?></h3>
|
313 |
|
314 |
-
<form method="POST">
|
315 |
<table class="optiontable form-table">
|
316 |
<tr valign="top">
|
317 |
<th scope="row"><label for="to"><?php _e('To:', 'wp_mail_smtp'); ?></label></th>
|
@@ -343,30 +344,6 @@ function wp_mail_smtp_menus() {
|
|
343 |
endif;
|
344 |
|
345 |
|
346 |
-
/**
|
347 |
-
* This is copied directly from WPMU wp-includes/wpmu-functions.php
|
348 |
-
*/
|
349 |
-
if (!function_exists('validate_email')) :
|
350 |
-
function validate_email( $email, $check_domain = true) {
|
351 |
-
if (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.
|
352 |
-
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
|
353 |
-
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email))
|
354 |
-
{
|
355 |
-
if ($check_domain && function_exists('checkdnsrr')) {
|
356 |
-
list (, $domain) = explode('@', $email);
|
357 |
-
|
358 |
-
if (checkdnsrr($domain.'.', 'MX') || checkdnsrr($domain.'.', 'A')) {
|
359 |
-
return true;
|
360 |
-
}
|
361 |
-
return false;
|
362 |
-
}
|
363 |
-
return true;
|
364 |
-
}
|
365 |
-
return false;
|
366 |
-
} // End of validate_email() function definition
|
367 |
-
endif;
|
368 |
-
|
369 |
-
|
370 |
/**
|
371 |
* This function sets the from email value
|
372 |
*/
|
@@ -390,9 +367,11 @@ function wp_mail_smtp_mail_from ($orig) {
|
|
390 |
return $orig;
|
391 |
}
|
392 |
|
393 |
-
if (defined('WPMS_ON') && WPMS_ON)
|
394 |
-
|
395 |
-
|
|
|
|
|
396 |
return get_option('mail_from');
|
397 |
|
398 |
// If in doubt, return the original value
|
@@ -410,8 +389,10 @@ function wp_mail_smtp_mail_from_name ($orig) {
|
|
410 |
|
411 |
// Only filter if the from name is the default
|
412 |
if ($orig == 'WordPress') {
|
413 |
-
if (defined('WPMS_ON') && WPMS_ON)
|
414 |
-
|
|
|
|
|
415 |
elseif ( get_option('mail_from_name') != "" && is_string(get_option('mail_from_name')) )
|
416 |
return get_option('mail_from_name');
|
417 |
}
|
@@ -426,7 +407,7 @@ function wp_mail_plugin_action_links( $links, $file ) {
|
|
426 |
if ( $file != plugin_basename( __FILE__ ))
|
427 |
return $links;
|
428 |
|
429 |
-
$settings_link = '<a href="options-general.php?page=
|
430 |
|
431 |
array_unshift( $links, $settings_link );
|
432 |
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP-Mail-SMTP
|
4 |
+
Version: 0.9.2
|
5 |
Plugin URI: http://www.callum-macdonald.com/code/wp-mail-smtp/
|
6 |
Description: Reconfigures the wp_mail() function to use SMTP instead of mail() and creates an options page to manage the settings.
|
7 |
Author: Callum Macdonald
|
106 |
}
|
107 |
|
108 |
// If you're using contstants, set any custom options here
|
109 |
+
$phpmailer = apply_filters('wp_mail_smtp_custom_options', &$phpmailer);
|
110 |
|
111 |
}
|
112 |
else {
|
146 |
|
147 |
// You can add your own options here, see the phpmailer documentation for more info:
|
148 |
// http://phpmailer.sourceforge.net/docs/
|
149 |
+
$phpmailer = apply_filters('wp_mail_smtp_custom_options', &$phpmailer);
|
150 |
|
151 |
|
152 |
// STOP adding options here.
|
241 |
<table class="optiontable form-table">
|
242 |
<tr valign="top">
|
243 |
<th scope="row"><?php _e('Mailer', 'wp_mail_smtp'); ?> </th>
|
244 |
+
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Mailer', 'wp_mail_smtp'); ?></span></legend>
|
245 |
<p><input id="mailer_smtp" type="radio" name="mailer" value="smtp" <?php checked('smtp', get_option('mailer')); ?> />
|
246 |
<label for="mailer_smtp"><?php _e('Send all WordPress emails via SMTP.', 'wp_mail_smtp'); ?></label></p>
|
247 |
<p><input id="mailer_mail" type="radio" name="mailer" value="mail" <?php checked('mail', get_option('mailer')); ?> />
|
312 |
|
313 |
<h3><?php _e('Send a Test Email', 'wp_mail_smtp'); ?></h3>
|
314 |
|
315 |
+
<form method="POST" action="options-general.php?page=<?php echo plugin_basename(__FILE__); ?>">
|
316 |
<table class="optiontable form-table">
|
317 |
<tr valign="top">
|
318 |
<th scope="row"><label for="to"><?php _e('To:', 'wp_mail_smtp'); ?></label></th>
|
344 |
endif;
|
345 |
|
346 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
/**
|
348 |
* This function sets the from email value
|
349 |
*/
|
367 |
return $orig;
|
368 |
}
|
369 |
|
370 |
+
if (defined('WPMS_ON') && WPMS_ON) {
|
371 |
+
if (defined('WPMS_MAIL_FROM') && WPMS_MAIL_FROM != false)
|
372 |
+
return WPMS_MAIL_FROM;
|
373 |
+
}
|
374 |
+
elseif (is_email(get_option('mail_from'), false))
|
375 |
return get_option('mail_from');
|
376 |
|
377 |
// If in doubt, return the original value
|
389 |
|
390 |
// Only filter if the from name is the default
|
391 |
if ($orig == 'WordPress') {
|
392 |
+
if (defined('WPMS_ON') && WPMS_ON) {
|
393 |
+
if (defined('WPMS_MAIL_FROM_NAME') && WPMS_MAIL_FROM_NAME != false)
|
394 |
+
return WPMS_MAIL_FROM_NAME;
|
395 |
+
}
|
396 |
elseif ( get_option('mail_from_name') != "" && is_string(get_option('mail_from_name')) )
|
397 |
return get_option('mail_from_name');
|
398 |
}
|
407 |
if ( $file != plugin_basename( __FILE__ ))
|
408 |
return $links;
|
409 |
|
410 |
+
$settings_link = '<a href="options-general.php?page=' . plugin_basename(__FILE__) . '">' . __( 'Settings', 'wp_mail_smtp' ) . '</a>';
|
411 |
|
412 |
array_unshift( $links, $settings_link );
|
413 |
|