Repeated headers in wp_mail
You use an index in your $header variable. AFAIK this should be left empty. Try $headers[] = trim( $content );
You use an index in your $header variable. AFAIK this should be left empty. Try $headers[] = trim( $content );
wordpress wp mail not changing sender mail
Note that the wp_mail filter runs before the wp_mail_content_type filter. If you’re using the PHP Mailer then you can try (untested): add_action( ‘phpmailer_init’, function( $phpmailer ) { if( ‘text/plain’ === $phpmailer->ContentType ) { $phpmailer->Body = ‘Filtered text here’; // <– Message override } });
Remove foreach and directly add this code: $client_infos = get_users($args); if($client_infos) { $client_email = $client_info[0]->user_email; $to = $client_email; $subject=”Due diligence is Complete”; $body = ‘Lorem ipsum’; wp_mail($to, $subject, $body); }
And there is no way it will work this way… In your JS you fill your data like so: var data = { ‘action’:’send_confirmation_email’, ’email’:’confirm_email’, ‘key’:’confirm_key’, ‘name’:’display_name’, ‘id’:’user_id’, ‘is_email’:’true’ }; And later, in your AJAX callback in PHP you use it as follows: wp_mail( $_REQUEST[’email’], $subject, $message, $headers ); So you’re trying to send email … Read more
* UPDATE * I have placed this function before the prev code // define the wp_mail_failed callback function action_wp_mail_failed($wp_error) { return error_log(print_r($wp_error, true)); } // add the action add_action(‘wp_mail_failed’, ‘action_wp_mail_failed’, 10, 1); Which helped me track the problem (using headers wrong). I share this in the hopes this helpes anyone while debugging wp_mail()
It’s pretty obvious from the log entries you posted that this isn’t a WordPress issue. I’d suggest working with your hosting provider to resolve the issue.
First you need to add a class for all checkbox as having same id for multiple items is not recommended <input type=”checkbox” class=”new_class” id=’haet_mail_test_address’ name=”ckboxs[]” value=””.$emails[$i][“user_email’].”‘> Now we to change the way you are getting the values from checkbox Change var checkbox = $(‘#haet_mail_test_address’).val(); To var checkbox = $(“.new_class:checkbox:checked”).map(function(){ return $(this).val(); }).get(); console.log(checkbox); // check … Read more
Send data URL string as an attachment in wp_email
Instead of using ‘post_updated’ for your hook, you might try ‘save_post’ or ‘wp_insert_post’