Using SMTP Function instead of Plugin (functions.php)
Using SMTP Function instead of Plugin (functions.php)
Using SMTP Function instead of Plugin (functions.php)
There are a couple of problems that may lead to failure of your script. First, you have a check for $mailSent at the top so you can redirect. However, at that point, it is undefined. It would be less likely to be a problem if you move it to where you check it at the … Read more
$post->post_author will return the ID of the post author, which you can then use with the WP_User object to retrieve the username and add to the outgoing email: if (get_option(‘jr_bcc_apply_emails’)==’yes’) : $author = new WP_User( $post->post_author ); $username = $author->user_login; $to = get_option(‘admin_email’); $subject = __(‘[copy] going for “‘, APP_TD).$post->post_title.'”‘; $message .+ ” {$username}”; wp_mail( … Read more
My usual solution for this is a plugin called WP Mail SMTP. The problem with this is that the plugin has not been updated in over 2 years. This means that issues with more recent versions of WordPress (although at present that shouldn’t be the case) and also means you are likely on your own … Read more
Instead of attaching the attachments to body content. Pass it as separate parameter. Like the below one. @wp_mail($to, $subject, $msg, $headers,$mail_attachment); I guess it solves your problem.
It’s look OK with : html_entity_decode wp_mail(“[email protected]”,”new article : “.html_entity_decode($get_title),”The message is OK with é è à”,$headers); Not so good, another try : wp_mail(“[email protected]”,”new article : “.$post->post_title,”The message is OK with é è à”,$headers);
Is there an actual [email protected] email address? And (more importantly) is the brazilbr.com the domain name of your site? If not, then your hosting place will ignore the ‘from’ email when it processes the wp_mail() command. You need to make sure that the ‘from’ email address you use in wp_mail() is an email address on … Read more
You cannot make a contact form without PHP code that sends the email. If you do not use a plugin, you have to write the code yourself and put it somewhere else, like in a theme. But putting it in a plugin is better. You also cannot put PHP code in the page or post … Read more
You could use the email address to get the user object, which will include the user ID. You can use the user ID to check the user’s capabilities to see if they have a capability assigned to the admin user role, and if not, unset the address: add_filter(‘wp_mail’,’disabling_emails’); function disabling_emails( $args ){ $user = get_user_by( … Read more
I’m going to assume the folks receiving these emails has gone through the whole two step opt in procedure or they have given their consent in some other way. There is an action called {$status}_{$post_type} that fires whenever a post is transitioned from one status to another. So when a post is published, the hook … Read more