Using SMTP Function instead of Plugin (functions.php)
Using SMTP Function instead of Plugin (functions.php)
Using SMTP Function instead of Plugin (functions.php)
Ended up setting up Gmail SMTP through the Gmail API, and this seemed to solve the problem in this case.
WordPress sends mail using the PHP mail() function. The easiest way to configure WordPress to use SMTP is through a plugin.
You need to have separate SPF records for each subdomain you wish to send mail from. The following was originally posted on openspf.org, which used to be a great resource for this kind of thing. Latest link http://www.open-spf.org/FAQ/The_demon_question/ The Demon Question: What about subdomains? If I get mail from pielovers.demon.co.uk, and there’s no SPF data … Read more
I suggest you first of all to separate code from markup, especially dividing your executing file like the function support_form(). Next, please try to send email without form with hard coded message. It is possible you have mis-configuration on your server if you developing on local machine. And finally, you should fill action attribute for … Read more
I believe what you need is the phpmailer_init action hook. Here is an something you can do. add_action( ‘phpmailer_init’, ‘custom_smtp_settings’ ); function custom_smtp_settings( $phpmailer ) { $phpmailer->isSMTP(); switch ($_SERVER[‘HTTP_HOST’]) { case ‘example1.com’: //name only, no http $phpmailer->Host=”smtp.example1.com”; $phpmailer->SMTPAuth = true; // Force it to use Username and Password to authenticate $phpmailer->Port = 25; $phpmailer->Username=”example1″; $phpmailer->Password … Read more
Every WordPress email usually uses wp_mail(). Which is actually a wrapper of PHPMailer. Find out this wp_mail() functions documentation and source code, you’ll find some hooks there which will be useful to you cases. But keep it in mind that, those hooks will be applicable only if the mail is sent by using wp_mail(). If … Read more
Sorted out myself: JSON file indeed was the issue I went back to Google Developer Console and choose to create Credentials again it then gave me an option of OAuth client Id and later an option to add origin and redirect urls which sorted the issue.
If you want to configure Gmail account, you need to fill Encryption type: SSL Port: 465 Requires Authentication: Yes Or you can try https://wordpress.org/plugins/wp-mail-bank/. This would help you in authenticating the Gmail account using oAuth.
But based solely on what you posted, the problem is the following: define( ‘SMTP_USER’, ‘[email protected]’ ); // The email address I use when I log in to the wp-admin page define( ‘SMTP_PASS’, ‘123password’ ); // The password I use when I log in to the wp-admin page define( ‘SMTP_HOST’, ‘localhost’ ); // I am testing … Read more