WordPress is executing URL in code when called via wp_mail()

I have written a custom plugin (that creates a custom post type) and allows any user to submit a new post from a form on my website. To prevent bots, I have setup an e-mail confirmation code which they must click, where this changes the post status from Draft to Published. Unfortunately the wp_mail() code … Read more

Change email from and display name with a filter action

I’m attempting to override the “from” display name and email address using the wp_mail() function. I am using the wp_mail_from filter hook to modify it with my custom function using add_filter(‘wp_mail_from’,’abcisupport_wp_mail_from’). If I hard code the value, it will return the address so it’s wired up properly. If I use the argument, it returns the … Read more

wp_mail recipient array not sending?

I am using wp_mail to send an email to multiple recipients. my mail function looks like this: wp_mail($group_emails, ‘my subject’, ‘my message’, $headers); $group_emails is an array of email address’s and gets outputed like this: $group_emails = Array ( [0] => [email protected] [1] => [email protected] [2] => [email protected] [3] => [email protected] [4] => [email protected] [5] … Read more

How to add line breaks to $email[‘body’] when using auto_core_update_email hook

I am using the auto_core_update_email hook to modify the auto update email sent by WordPress. However I cannot figure out how to add line breaks to the email body. Here’s my code: function example_filter_auto_update_email($email) { $email[‘to’] = array(‘[email protected]’, ‘[email protected]’); $email[‘subject’] = ‘Auto Update’; $email[‘body’] = ‘Hello,%0D%0A’ . ‘Lorem ipsum.%0D%0A’ . ‘Many thanks,%0D%0A’ . ‘WordPress’; return … Read more

If new comment posted in custom post – send notification to custom email from custom field

I have custom post type “Art masters”. Each post is master’s profile. In their profiles isset custom fiels name “master_email”. I need to send for master email notification every time if new comment is posted. How i can call post new comment function for use wp_mail? Thank you for help! 2 Answers 2 You can … Read more

wp_mail() is not working in localhost

I’m trying to test wp_mail() in my local. When I var dump wp_mail,I get Boolean false.This is my code $to = “[email protected]”; $subject=”my subject”; $message=”I would like to work with you”; $headers=””; $sent_message = wp_mail( $to, $subject, $message, $headers); var_dump($sent_message); // i get boolean false here. if ( $sent_message ) { echo ‘The test message … Read more

Should I use wp_mail or PHP’s mail? [duplicate]

This question already has an answer here: What is the advantage of using wp_mail? (1 answer) Closed 4 years ago. I have an email system that I am making in a WordPress plugin to send the emails with this code: include(PLUGIN_DIR.’config/class_phpmailer.php’); $email = new PHPMailer(); $email->From = get_option(‘admin_email’); $email->FromName=”my name”; $email->Subject = $subject; $email->Body = … Read more

Claim Listing functionality – how to send email to users when their claim has been approved or denied

We have a claim listing plugin, it allows items(posts) to be claimed by users. It requires the user to “register” in order to claim that item therefore they have to enter a username and their email. After they have submitted a claim, an email will be sent to the admin email(us) that a user is … Read more

wp_mail line break not working

I have an interface to send e-mails through SMTP (I use the plug-in Postman SMTP). I collect messages in the DB that I sent to someone depending on the results of an SQL request. In the DB, I stored the messages using the char 
 for line breaks. Here is the code (I replace e-mail … Read more