Wp_Mail and Contact Form 7

try this one add_filter(‘wp_mail_from’, ‘doEmailFilter’); add_filter(‘wp_mail_from_name’, ‘doEmailNameFilter’); function doEmailFilter($email_address){ if($email_address === “[email protected]”) return ‘[email protected]’; else return $email_address; } function doEmailNameFilter($email_from){ if($email_from === “WordPress”) return ‘MySite.com’; else return $email_from; } This checks if WP is going to send mail as a system (as wordpress@something) and if so, changes to your setting. Otherwise, is using inputs data … Read more

How to send language string in email message body

You have a typo in your code, the function is __() with two underscores. You will also need to configure the textdomain ‘text-domain’ and have a valid translation for the end users’ browser settings for it to not default to english. // use two underscores in the method $message = __(“Hello Admin,”,’text-domain’); // assuming this … Read more

How to send multiple email to different addresses

Ok even your question is difficult to read, here we go with I understand: If you want to send one message to multiple email address you have more than one options but lets see two most used: // FIRST // One message to many addresses, this one is simplest, but every person will see each … Read more

WordPress wp_mail function not working, returns false

Although wp_mail returns false on failure, it does also contain an action hook to allow you access to error information. If phpmailer fails to send, these lines run: /** * Fires after a phpmailerException is caught. * * @since 4.4.0 * * @param WP_Error $error A WP_Error object with the phpmailerException message, and an array … Read more

Sending mails with wp_mail() to multiple recipients using wp_cron and dynamic email body data

Here’s your problem: $body = file_get_contents( get_stylesheet_directory() . ‘/templates/email/event-creator-notification.php’); file_get_contents literally just gets the contents of that file. There’s no PHP execution. Instead, if you want to get the output of something as a variable, use output buffers, e.g. ob_start(); // everything echo’d after this gets put in the buffer get_template_part( ‘templates/email/event-creator-notification’ ); $body = … Read more

If/elseif statement within wp_mail function

This is problem with your PHP syntax, not WP. You are using assignment (=) where you should be using comparison (==). So this: if( $problem_type=”phones” ) should really be this: if( ‘phones’ == $problem_type ) And same for other condition.

wp_mail sending old content from post

There’s a few things you need to do here, you need to modify your add_action() to accept additional arguments and you need to specify whether to use the data before the update or the data after the update. Try something like this: function send_media_emails($post_id, $post_after){ if(defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return; if(get_post_status($post_id) == ‘draft’ or get_post_status($post_id) == … Read more

wp_mail sending mail twice!

Thanks for the comments! I figured it out. I tried the regular php mail function and still the same thing. Then I decided to make a page template and add only the mail() function, get_header(), and get_footer(). It still sent it out twice. So I opened my header.php and commented the wp_head() function to rule … Read more

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedusedusedueduseduseduseduseduedu