A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [wp-mail]

wp_mail() is a wrapper for PHPMailer which is a wrapper for PHP’s mail() function.

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Sending bulk mail to a certain number of users

We would like to send bulk mail to the user list using wp_mail() function. Is it possible to send e-mail to users at a certain time (similar to newsletter plugins)? For example, dividing the list of ...
0
votes
2answers
37 views

Including user data in “new user notification email”

I'm trying to create a function that sends an email to the admin when a new user registers. I would like the email to contain the users first name, last name, email address, and billing information ...
0
votes
1answer
27 views

Can't change headers / From for wp_mail()

i tried nearly anything to change the From / Reply-to name for the wp_mail() function. Here is my code: $headers = "From: \"FROM NAME\" <from-mail@from.com>\n"; $headers .= "Return-Path: <...
2
votes
1answer
29 views

Must I change the admin user email address while changing the general email address?

I changed the email at Settings > General from me@gmail.com to info@mysite.com. It seems like the email didn't change, although I received the confirmation email to change. I'm still receiving emails ...
2
votes
1answer
27 views

wp_mail not running inside Cron

The wp_mail() function is not running when scheduled in a cron function. I have added the following function: add_filter( 'cron_schedules', 'isa_add_every_one_minutes' ); function ...
1
vote
1answer
27 views

Send emails with wp_mail() using SMTP configured in plugin

I have the plugin Easy WP SMTP installed and there I have configured sending my WordPress mails with SMTP. I send emails with a cronjob to my users with the wp_mail() function. I was asking myself, ...
0
votes
1answer
25 views

Send a email base on a taxonomy term

I like to have a email send if a custom post is created/updated if it has custom taxonomy term. The here is the CPT, taxonomy and term. Custom Post Type: Call Custom taxonomy: call_type Custom ...
0
votes
0answers
43 views

Contact form with file upload

I'm trying to create a contact form that lets users upload files. This is the PHP code I have: function ajax_contactform_action_callback() { $error = ''; $status = 'error'; if (empty($_POST['name']...
0
votes
1answer
68 views

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

I have a frontend submission form, where users can add events to a custom post type. I want to send an email to each user 1 week before this event takes place. The emails are sent via wp_cron. The ...
0
votes
1answer
26 views

Add multiple recipients via BCC on wp_mail()

I created a function which returns an array of email addresses: // returns all wanted email adresses leweb_get_events_detail(); This is the given array: Array ( [0] => mail@example.com [...
0
votes
0answers
35 views

How can I remove the product short description from the WooCommerce Mails?

I do have a rather large short description because it does fit perfectly with my theme, but unfortunately those information are added to the emails that are send to customers and mess with their ...
3
votes
1answer
47 views

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. ...
0
votes
0answers
34 views

Using a SendGrid transactional template with wp_mail

I want to use a SendGrid transactional template to format emails which I am sending using the wp_mail function. I'm sending emails like this: function mytheme_send_email($user, $message){ $...
0
votes
0answers
14 views

Send email details at user after registration

I'm using Wordpress and I realized my custom theme. Now I'm trying to manage emails (especially those to send to a registered user and password recovery) The problem now is that emails are not sent. ...
0
votes
1answer
145 views

Sending a custom form data in email through WP Mail Function

Before posting this post I have browsed these resources: On form submission how to send 2 email to different users https://stackoverflow.com/questions/17157685/php-redirect-to-another-page-after-...
1
vote
1answer
47 views

How do I set wp_mail arguments/manually force wp_mail sending based on the sender's email address?

I need a way to query the sender's email address before delivery is attempted, and then set wp_mail arguments depending on the results. So something like the following: If sender_email contains @...
0
votes
1answer
171 views

How to use PHPmailer in a function in WordPress

I have a function in the WordPress functions.php file that searches for a condition in user meta and sends an email to a user based on what it finds. I currently use wp_mail() to send the email, and ...
1
vote
2answers
19 views

test email is working but not sending email with wp mail [closed]

wp_mail($emails, 'New Contact Enquiry | ' . $subject, $message, $headers, $attachments) but getting this error. WP_Error Object ( [errors] => Array ( [2] => Array ( [0] => SMTP Error: data not ...
0
votes
1answer
111 views

WP Mail plugin not sending the mail

the plugin WP Mail SMTP v1.4.2 logged this error during the last time it tried to send an email: Mailer: Default (none) PHPMailer was able to connect to SMTP server but failed while trying to send an ...
0
votes
1answer
132 views

wc_mail in foreach loop is sending only the first email

I'm trying to send emails in a foreach loop from a db query and all fine here, but i need to send emails fo each id on the table and only works once, but is not showing any error, seems all fine!. ...
0
votes
1answer
236 views

Custom user registration fields in user_register hook

I am trying to send an email to administrator with user_register action hook and wp_mail() function when a new user registers. I created some custom registration fields and I want send them via e-mail,...
0
votes
0answers
52 views

Mail not working on WordPress site

Mail is configured and is working on other sites in localhost but I am not able to find the problem with current WordPress project I am working on. I tested using WP Mail SMTP plugin also but it's ...
0
votes
2answers
322 views

Cron not sending wp-mail()

I have a problem with a cron schedule function, it does not want to send an email with the wp_mail() function. This is my code: It is placed in the functions.php <?php add_filter('...
0
votes
1answer
70 views

New user notification issue

I'm having an issue with our business' website. Every new user that registers on our site will never get an email confirmation which has the randomly generated password. As for us, the admins, we do ...
0
votes
1answer
55 views

Adding a button to send email to a user in WordPress Admin Users table

I would like to add a button for each user in the user page in wordpress admin area that will send an email to that specific user when clicked. The code adds the action link "Send Verification Email" ...
0
votes
2answers
736 views

Email always ends up in spam

I created a function which I use to send an email when a specific button is pressed. This works great, except that it always ends up in spam instead of the inbox. This is the function: function ...
0
votes
1answer
428 views

Generate and send ICS file through WordPress

I'm writing a custom plugin for reservations. I need to generate an .ics file that needs to be sent to a predefined email address. I've tried some library like ZContent iCalendar and a PHP script ...
0
votes
1answer
89 views

phpmailer_init ignored on REST calls

For testing purposes I've set up a mailtrap (dummy SMTP server) to catch all mail in and out of my local site. To do so, I hooked its configuration in the theme's functions.php like this: function ...
0
votes
2answers
40 views

add_action( 'publish_pelicula', 'post_published_notification', 10, 2 ); does not trigger propperly

I'm trying to send an Email before a post "type:pelicula" is submited, but it does not enter to the function post_published_notification, here is the code: <?php /** * Plugin Name: VRlife Alertas ...
0
votes
1answer
565 views

WordPress wp_mail function not working, returns false

I am sending email with the wp_mail() function but it is not working. It is returning false. Also it is not giving any error in the server log. This is my code: $mailResult = false; ...
0
votes
1answer
54 views

wp_mail doesn't work when logged in?

I am having trouble with a wp_mail function I created, which sends an email when I press a button. It does work great when you do this logged out. But as soon as I am logged in it stops working. It is ...
1
vote
1answer
248 views

Redirect to another page after submission using wp_mail

I'm trying to redirect to user to another page after the form has been submitted using wp_mail. // Hooking up our functions to WordPress filters add_filter( 'wp_mail_from', 'wpb_sender_email' ); ...
1
vote
0answers
22 views

Multisite not using subdomains as hostname in from address when sending emails

I have a Multisite installation where I'm facing somekind of bug relating the hostname used when WordPress sends emails (I've test it with WordPress admin emails and Contact Form 7). For example, if ...
0
votes
1answer
137 views

Why do WordPress emails to multiple recipients include \n in the list

All emails from WordPress are not going to multiple emails for some reason. They have been entered in separated by commas. However when I check the mail log the recipient list is like this: ...
0
votes
1answer
40 views

Premature end of script headers: wp-mail.php?

I haven't edited wp-mail.php at all. I'm using the default WordPress file. I'm trying the whole submit post by email function that we know in settings (using gmail and pop3, if that's relevant). I ...
0
votes
1answer
181 views

Can I use shortcodes in mail body

Can I put any type of custom shortcode for some content in mail body? eg: $to = "test@test.com"; $subject = "Test Email"; $packages = do_shortcode('[test id="0000"]'); $message = $packages; // ...
0
votes
1answer
203 views

Attach a external file as attachement using wp_mail

I am trying to attach external file link (doc file) as attachment but not able to so .. no attachment is being attached.. $email_attachment = array('https://ucarecdn.com/8aa17c61-bd55-4311-8b45-...
0
votes
1answer
27 views

Allow user to add the php code in wp_mail()

I have an email triggered like below. I want a user to be able to customize the content. I want to provide the user to be able to put esc_html($user->display_name) somehow may some thing with a ...
2
votes
2answers
416 views

How to use wp_mail in CPT page

I have a CPT and inside the CPT I have a contact form. The contact form directly sends to WordPress dashboard, Now I'm trying to implement when a user submits the contact form they will receive a "...
1
vote
1answer
438 views

On form submission how to send 2 email to different users

I have created a custom php form and on its submission email is sent to user but i want to send email to admin as well to keep admin up-to-date about form submissions on website using wp_mail. <...
1
vote
1answer
678 views

wp_mail not sending attachment

My mail function is as follows add_action('wp_ajax_order_processing', 'order_processing'); function order_processing(){ include 'mail-translations.php'; require_once( ABSPATH . 'wp-admin/includes/...
1
vote
2answers
295 views

How to do string attachment with wp_mail

I'm using a gift card plugin for my woocommerce shop and I would like to add a generated pdf file to allow customers to download the gift card as a pdf. The idea is to use TCpdf or Fpdf to generate ...
0
votes
1answer
352 views

Retrive acf fields in publish_post action for wp_mail

I have a custom post type called "Envios". In it I've created a Custom Meta box which allows to select users and posts. When one of this custom post types is published it sends an email to the ...
0
votes
1answer
101 views

get_post_meta not working with variable as a post_id for dynamically get the postid

I would like to use the get_post_meta to pull a value from a CPT dynamically and then send a email. The problem is that the get_post_meta($post->ID, ... part of the code does not pull the email ...
3
votes
2answers
170 views

How to set up gmail SMTP in Wordpress

I'm trying to set up an SMTP gmail server to send emails from my WordPress site. This is what I've got in my wp-config.php: define( 'SMTP_USER', 'myaddress@gmail.com' ); // Username to use for ...
0
votes
1answer
182 views

How can I configure an SMTP Server?

I'm trying to follow the instructions here: https://gist.github.com/butlerblog/7e4dbafcbc61b15505ee8ca90510f1e7 But I'm getting confused. I'm not sure what arguments to pass where. Here is what I ...
0
votes
2answers
44 views

Include content post Wordpress - Email notification

I have this mail notification for new post. All the new post contain arround 100 words and no pictures, so I would like to include in the notification the post content and if is possible, the number ...
0
votes
1answer
32 views

Different query result on local and server

I create plugin to sent list post yesterday and today via wp_mail() to member from WordPress multisite, at localhost the result of list post delivery successful. But at live server, the result of ...
0
votes
1answer
13 views

Email me when front posting or update post

In my site, users can submit post at front-end. And I want to be informed by email when users submit or update post. I searched some codes about this. I'll use wp_main function. function ...
2
votes
1answer
40 views

User invite email not delivered - related to subdomain?

I have a problem where, on a new install of WordPress, I want to add a new user, but the user is not receiving the email with the confirmation link. I've done some research and understand that this ...