You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
microsoft mail like ['@live.com','@msn.com','@outlook.com','@live.co.uk','@hotmail.com','@hotmail.co.uk'];
always return my email, so i block it from sending to those emails ending with @live.com','@msn.com','@outlook.com','@live.co.uk','@hotmail.com','@hotmail.co.uk'
I replace fluent-smtp.php
function fluentSmtpInit() {
$application = new FluentMail\Includes\Core\Application;
add_action('plugins_loaded', function () use ($application) {
do_action('fluentMail_loaded', $application);
});
}
fluentSmtpInit();
if (!function_exists('wp_mail')):
function wp_mail($to, $subject, $message, $headers = '', $attachments = array()) {
return fluentMailSend($to, $subject, $message, $headers, $attachments);
}
else :
if (!(defined('DOING_AJAX') && DOING_AJAX)):
add_action('init', 'fluentMailFuncCouldNotBeLoadedRecheckPluginsLoad');
endif;
endif;
With
function fluentSmtpInit() {
$application = new FluentMail\Includes\Core\Application;
add_action('plugins_loaded', function () use ($application) {
do_action('fluentMail_loaded', $application);
});
}
fluentSmtpInit();
if (!function_exists('wp_mail')) :
function wp_mail($to, $subject, $message, $headers = '', $attachments = array()) {
// List of domains to block
$blocked_domains = ['@live.com','@msn.com','@outlook.com','@live.co.uk','@hotmail.com','@hotmail.co.uk'];
// Ensure $to is an array
if (!is_array($to)) {
$to = explode(',', $to);
}
// Filter recipients based on blocked domains
$filtered_recipients = array_filter($to, function ($email) use ($blocked_domains) {
foreach ($blocked_domains as $domain) {
if (strpos($email, $domain) !== false) {
// Log blocked emails (optional)
error_log("Blocked email to $email");
return false; // Exclude this email
}
}
return true; // Allow this email
});
// If no valid recipients remain, block the email
if (empty($filtered_recipients)) {
error_log("No valid recipients left after filtering. Email not sent.");
return false; // Prevent email from being sent
}
// Update recipients
$to = implode(',', $filtered_recipients);
// Proceed with sending the email
return fluentMailSend($to, $subject, $message, $headers, $attachments);
}
else :
if (!(defined('DOING_AJAX') && DOING_AJAX)) :
add_action('init', 'fluentMailFuncCouldNotBeLoadedRecheckPluginsLoad');
endif;
endif;
The text was updated successfully, but these errors were encountered:
microsoft mail like ['@live.com','@msn.com','@outlook.com','@live.co.uk','@hotmail.com','@hotmail.co.uk'];
always return my email, so i block it from sending to those emails ending with @live.com','@msn.com','@outlook.com','@live.co.uk','@hotmail.com','@hotmail.co.uk'
I replace fluent-smtp.php
With
The text was updated successfully, but these errors were encountered: