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
1
vote
0answers
23 views

Has WP 5.7.2 possibly changed the email process, specifically, does anyone know where to find a list of PHPMAILER_EXCEPTION_CODES? [closed]

Been using a Form plugin for several years (forms haven't changed for some time) and up until recently these forms have been fully functional ... specifically ... they are supposed to send both a ...
1
vote
1answer
41 views

How can I send the mail once?

I am working on a marketplace plugin. If the vendors do not accept the order within the date range I set, the order will be cancelled. For this, I have determined a time period of order date +3 days. ...
1
vote
0answers
55 views

Running SMTP Conditionally

I'm working on developing a support website and I'm using Gravity Forms to handle the support ticket form. I have the form notification configured so that the "From" shows my client's email ...
1
vote
1answer
49 views

How Can I Change Default Reply ToEmail

I want to set the SMTP settings manually instead of using a plugin. I did this using this resource. However, there is a problem. If the user clicks "Reply", a different e-mail appears. ...
1
vote
1answer
62 views

PHP 8, AJAX mail form to function.php doesn't work

I have code that send message to email, it works at PHP 7.2, but after we changed version to PHP 8 it didn't works. Maybe someone have ideas whats wrong? Function.php function true_add_ajaxform(){ $...
0
votes
2answers
36 views

Change the Sender(not From) on wp_mail() function [closed]

I'm using the Post SMTP Plugin, but I manually send email via the wp_mail() function. The gmail client shows the correct From:, but when I switch to outlook or another email client, shows the ...
0
votes
0answers
11 views

Email 'Magic Link' to Access Content (not login)

I'm developing a site where users have their own 'profile' pages but which won't be public. I have a redirect in place currently which sends the visiting user away if not logged in (and not the owner)....
-2
votes
1answer
64 views

WordPress is not sending the 2nd email in the same request

When I try to send more than one email message in the same request, only de 1st message is sent, the rest of the messages are blocked with the error "Message body empty". The following code ...
0
votes
0answers
11 views

How do I add a BCC field to a WP_MAIL function on Wordpress [duplicate]

I need some help from someone. I managed to get this below code working on sending emails to a certain user role. However, when the emails sends it sends to all 200 people and they can all see each ...
0
votes
0answers
24 views

Wordpress wp_mail function crashing website

So i've been trying to send email from my functions.php script. When wp_mail function is fired, my entire website crashes. I have enabled all the error display settings in wp-config. I literally ...
3
votes
1answer
662 views

WordPress “phpmailer_init” not working for me

I add the following code to the functions.php file. add_action( 'phpmailer_init', 'my_phpmailer_example' ); function my_phpmailer_example( $phpmailer ) { $phpmailer->isSMTP(); $...
0
votes
0answers
22 views

How do I use my own SMTP server for WP Mail SMTP?

I'm developing a WordPress site on a Microsoft Azure server. I've installed WordPress on this server, and I've also installed the WP Mail SMTP WordPress plugin. I've also installed the SMTP service on ...
0
votes
0answers
194 views

Updated : how to make email optional while user registration using default wordpress form

I wonder if there is any way to make email an optional field while registering using default form. So that those who don't know mail may leave it blank. I got code from stackexchange but that doesn't ...
0
votes
0answers
21 views

POSTMAN SMTP cannot match TLD against known list

I am using Postman SMTP plugin 2.0.11 I am having problems with sending email through the wp_mail() function. Most of the time it works ok, but sometimes it does not send the email and whips out this ...
0
votes
1answer
666 views

Attach pdf from dynamic url

When I save a custom post, I would like to send a PDF by email as attachment. I tried that : function my_custom_save_post( $post_id, $post, $update ) { if( ! $update ) { return; } if( ...
0
votes
1answer
786 views

Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0

I am trying to make a email template for my wordpress site. So I tried to include the HTML mockup that was given to me, but instead of putting it directly on the same file, I would like to include() ...
0
votes
1answer
114 views

wp_mail only sends emails to gmail

wp_mail only sends emails to gmail and i receive emails only on gmail inbox but in dedicated servers couldnt send recieve anything even as spam followed data works well only to gmail ...
0
votes
1answer
378 views

wp_mail send multiple emails in a loop

I'm very confused with wp_mail(). Here my code. function email_notification_for_admin_and_customer( $order_data ) { $subject_email = 'Subject LOREM IPSUM'; $customer_email = 'Hi Customer, ...
0
votes
0answers
135 views

How to send a particular csv file as an email?

I have created a function to run a query and create a CSV file. The CSV file will be stored in a particular folder on my server. These files are distinguished by dates. I want to schedule an event ...
1
vote
0answers
39 views

Unable to send custom welcome email after user register

I am trying to send a custom welcome email after user register on our website. The default role set is 'subscriber'. The email should pull some user meta values and display the same in the email. I ...
0
votes
2answers
24 views

Notify users only on post publish

I am using this function to notify users when their post is published. However, repeated emails are being sent when the post is updated. I only want to send 1 email when the post is published first ...
0
votes
0answers
59 views

Faster Emails with WP Mail

I'm using wp_mail() to send transactional emails on my website, but it takes very long to process the email. What can I do to speed up this process?
0
votes
1answer
105 views

What is the best way to send out thousands of emails from a WordPress site? [closed]

We are currently using SendGrid API to send transactional emails. This is very slow and it freezes the process. How do you send out 5000+ emails on a WordPress site? We are currently using SendGrid ...
0
votes
1answer
649 views

Wordpress email could not be sent

I have faced an error while forgetting email password in WordPress link : /wp-login.php?action=lostpassword After submitting email faced below errors: ERROR: The email could not be sent. Your site ...
0
votes
1answer
36 views

Pass Variables or Variable Place-Holder from Editor to PHP

I'm building a method for my client to construct a message content to be sent with wp_mail. Within that I'd like them to be able to choose variables, for example the message might look like this in my ...
0
votes
1answer
184 views

wp_mail function not working in WordPress Plugin Boilerplate

I am creating a plugin using WordPress plugin boilerplate (https://wppb.me/), I have create a separate file for sending emails under /admin/partials/ directory. but wordpress throw error when I am ...
0
votes
0answers
115 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
62 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
154 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
83 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
331 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
317 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
116 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
59 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
615 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
1k 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
188 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
130 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
235 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
1answer
2k 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
243 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 @...
2
votes
2answers
13k 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
24 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
210 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
366 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
2k 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
94 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
1k 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
207 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
1k 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" ...

1
2 3 4 5
7