Quantcast
Channel: WordPress.org Forums » [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin] Support
Viewing all articles
Browse latest Browse all 5161

kostasx on "[Plugin: WP Mail SMTP] If test mail fails produce a different debug output styling"

$
0
0

Hi,

first of all thanks for creating and sharing this really useful plugin.

One thing that troubled me was that the debug output styling was always green ("the CSS class = .updated" was used) even if the test mail was unsuccessful.

So I went on and added a couple of lines to change the debug output class to .error whenever the test email failed:

FILE: wp_mail_smtp.php

Line#207 Added just after:$smtp_debug = ob_get_clean();

// CHECK IF AN ERROR OCCURED AND DISPLAY OUTPUT USING .error CLASS
$notificationClass = ( $phpmailer->ErrorInfo === "" ) ? "updated" : "error" ;

And replaced:

<div id="message" class="updated fade"><p><strong><?php _e('Test Message Sent', 'wp_mail_smtp'); ?></strong></p>

with this:

<div id="message" class="<?php echo $notificationClass; ?> fade"><p><strong><?php _e('Test Message Sent', 'wp_mail_smtp'); ?></strong></p>

Now, whenever an error occurs, the debug output is displayed in red, signifying an error when sending test mail. Otherwise, the green output -we all love and worship- is being displayed.

I hope this helps some people out there when debugging connectivity issues.

Once again, thanks for the plugin!

https://wordpress.org/plugins/wp-mail-smtp/


Viewing all articles
Browse latest Browse all 5161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>