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 5014

casiepa on "[Plugin: WP Mail SMTP] Contact form is not working while using Yahoo smtp"

$
0
0

Hi partha.rkl,
I had a similar thing. What I did was first installing a mail log plugin to see what the headers contained (like https://wordpress.org/plugins/wp-mail-logging/ ).
Then I forced the FROM to always be what was set by WP-mail-SMTP in my own plugin using the below code.
That seems to have solved for me.
Pascal.

/**
* Since the install of WP-Mail-SMTP we need to make sure the FROM is the same as the one specified in the plugin
* These filters will overwrite any FROM send by other plugins.
*/
add_filter('wp_mail_from','custom_wp_mail_from');
function custom_wp_mail_from($email) {
	return get_option('mail_from');
}
add_filter('wp_mail_from_name','custom_wp_mail_from_name');
function custom_wp_mail_from_name($name) {
	return get_option('mail_from_name');
}

Viewing all articles
Browse latest Browse all 5014

Trending Articles



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