updated plugin `SMTP Mailer` version 1.1.11

This commit is contained in:
KawaiiPunk 2023-12-08 23:23:24 +00:00 committed by Gitium
parent 4a935cafb4
commit fa428d9da9
2 changed files with 35 additions and 43 deletions

View File

@ -1,7 +1,7 @@
<?php
/*
Plugin Name: SMTP Mailer
Version: 1.1.9
Version: 1.1.11
Plugin URI: https://wphowto.net/smtp-mailer-plugin-for-wordpress-1482
Author: naa986
Author URI: https://wphowto.net/
@ -16,8 +16,8 @@ if (!defined('ABSPATH')){
class SMTP_MAILER {
var $plugin_version = '1.1.9';
var $phpmailer_version = '6.8.0';
var $plugin_version = '1.1.11';
var $phpmailer_version = '6.8.1';
var $plugin_url;
var $plugin_path;
@ -274,6 +274,10 @@ class SMTP_MAILER {
if(isset($_POST['from_name']) && !empty($_POST['from_name'])){
$from_name = sanitize_text_field(stripslashes($_POST['from_name']));
}
$force_from_address = '';
if(isset($_POST['force_from_address']) && !empty($_POST['force_from_address'])){
$force_from_address = sanitize_text_field($_POST['force_from_address']);
}
$disable_ssl_verification = '';
if(isset($_POST['disable_ssl_verification']) && !empty($_POST['disable_ssl_verification'])){
$disable_ssl_verification = sanitize_text_field($_POST['disable_ssl_verification']);
@ -289,6 +293,7 @@ class SMTP_MAILER {
$options['smtp_port'] = $smtp_port;
$options['from_email'] = $from_email;
$options['from_name'] = $from_name;
$options['force_from_address'] = $force_from_address;
$options['disable_ssl_verification'] = $disable_ssl_verification;
smtp_mailer_update_option($options);
echo '<div id="message" class="updated fade"><p><strong>';
@ -301,6 +306,11 @@ class SMTP_MAILER {
$options = smtp_mailer_get_empty_options_array();
}
// Avoid warning notice since this option was added later
if(!isset($options['force_from_address'])){
$options['force_from_address'] = '';
}
// Avoid warning notice since this option was added later
if(!isset($options['disable_ssl_verification'])){
$options['disable_ssl_verification'] = '';
@ -374,6 +384,12 @@ class SMTP_MAILER {
<p class="description"><?php _e('The name which will be used as the From Name if it is not supplied to the mail function.', 'smtp-mailer');?></p></td>
</tr>
<tr valign="top">
<th scope="row"><label for="force_from_address"><?php _e('Force From Address', 'smtp-mailer');?></label></th>
<td><input name="force_from_address" type="checkbox" id="force_from_address" <?php checked($options['force_from_address'], 1); ?> value="1">
<p class="description"><?php _e('The From address in the settings will be set for all outgoing email messages.', 'smtp-mailer');?></p></td>
</tr>
<tr valign="top">
<th scope="row"><label for="disable_ssl_verification"><?php _e('Disable SSL Certificate Verification', 'smtp-mailer');?></label></th>
<td><input name="disable_ssl_verification" type="checkbox" id="disable_ssl_verification" <?php checked($options['disable_ssl_verification'], 1); ?> value="1">
@ -420,6 +436,7 @@ function smtp_mailer_get_empty_options_array(){
$options['smtp_port'] = '';
$options['from_email'] = '';
$options['from_name'] = '';
$options['force_from_address'] = '';
$options['disable_ssl_verification'] = '';
return $options;
}
@ -659,7 +676,11 @@ function smtp_mailer_pre_wp_mail($null, $atts)
* @param string $from_name Name associated with the "from" email address.
*/
$from_name = apply_filters( 'wp_mail_from_name', $from_name );
//force from address if checked
if(isset($options['force_from_address']) && !empty($options['force_from_address'])){
$from_name = $options['from_name'];
$from_email = $options['from_email'];
}
try {
$phpmailer->setFrom( $from_email, $from_name, false );
} catch ( PHPMailer\PHPMailer\Exception $e ) {

View File

@ -2,9 +2,9 @@
Contributors: naa986
Donate link: https://wphowto.net/
Tags: email, mail, smtp, phpmailer
Requires at least: 6.3
Tested up to: 6.3
Stable tag: 1.1.9
Requires at least: 6.4
Tested up to: 6.4
Stable tag: 1.1.11
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -56,42 +56,7 @@ For detailed setup instructions please visit the [SMTP Mailer](https://wphowto.n
1. Click "Install Now" and then hit the activate button
== Frequently Asked Questions ==
= Can I send email via SMTP from my website using this plugin? =
Yes.
= Can I use this plugin with Gmail SMTP? =
Yes.
= Can I use this plugin on any SMTP port? =
Yes.
= Can I use this plugin with Sendinblue SMTP? =
Yes.
= Can I use this plugin with Mailgun SMTP? =
Yes.
= Can I use this plugin with SendGrid SMTP? =
Yes.
= Can I use this plugin with Postmark SMTP? =
Yes.
= Can I use this plugin with Office365 SMTP? =
Yes.
= Can I use this plugin with ZohoMail SMTP? =
Yes.
none
== Screenshots ==
@ -103,6 +68,12 @@ none
== Changelog ==
= 1.1.11 =
* WordPress 6.4 compatibility update.
= 1.1.10 =
* Added an option to set the configured from address for all outgoing email messages.
= 1.1.9 =
* Additional check for the settings link.