Problem using wp_mail function

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

wp_mail BCC admin

$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

wp_mail issue with sending PDF

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.

wp_mail ignores the name in From field

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

How to disable wp_mail for all users except for admins?

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

wp_mail – using a custom field value for $to

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

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedueduedueduseduseduedusedus