Questions tagged [wp-mail]
48 questions
0
votes
1 answer
Unable to send attachment in email using wp_mail() and amazon ses
I have added the following code to send attachments using wp_mail() function. The Runcloud server on which the code is hosted is configured with Amazon SES. On that, the attachment is not sent with the mail, the same code runs perfectly on the local…
0
votes
0 answers
How to pass the dynamic data into the wpmail() in cron job wordpress
enter code herei wants to pass contact form entries into the wpmail() in cron job. but the dynamic data not pass insite the wpmail function .pls help me to resolve this

ME ME
- 1
0
votes
1 answer
How to clear $_POST data in Wordpress to avoid double submit on refresh
I am using the script below to send my contact form. But if any user refresh the page, the email is sent a second time with the same data. I tried to use
$_POST = array();
But it's not working. I also tried to use header('location'), but I always…
user11791297
0
votes
1 answer
Wordpress wp_mail() returns false
I'm new in plugin development. I would like to use this simple function in Wordpress to send mail to users. I saw this code in the documentation everything is simple and straight forward but this code returns false. Why ?
require_once explode(…

Viktor Tóth
- 3
- 2
0
votes
0 answers
WordPress wp_mail called from function
im trying to create a WordPress plugin for first time.
What i want from this plugin is really simple. I need to show form with 2 fields one for Subject second for message. Then take all registered users emails and use this data in wp_mail.
Then use…

k4znIm
- 65
- 1
- 1
- 7
0
votes
1 answer
Wordpress Sending email through Ajax without page refresh hangs on admin_ajax.php
I have this test page on a website - https://piclits.com/test-slideshow/
It displays a bunch of images/PICLITS and grabs them randomly from a folder 12 at a time into a slideshow.
I want to email the main image without refreshing the page (which…

studebaker
- 1
- 3
0
votes
0 answers
How do i send a mail using wp_mail in local it doesnt work
I am running this in my localhost. when i publish a post nothing happens. I have added this in my themes functions.php file. How do i check the error? I dont see any error. I am new to development.
add_action('publish_post', 'sendnotification');
…

Lavanya Reddy
- 1
- 1
0
votes
1 answer
wp mail function is not working in conditions
I have a step form. I need to send email if i click next button. It works only if i click 2nd step next button. Here is my jquery:
let ajaxurl = 'admin-ajax.php';
let i=0;
jQuery( ".btn-next" ).each(function() {
jQuery(this).on("click",…

Shawn
- 1,232
- 1
- 14
- 44
0
votes
2 answers
Wordpress: Send a notification when a user registers, but only for users with Subscriber role
I'm trying to send have my site send me a notification email when someone registers with the role subscriber. I can probably achieve that with a hook on mu-plugins but I don't know where to start or which hook to use. Tried adding an if statement…

Alejandro Nieto
- 49
- 6
0
votes
1 answer
Sending an email with form variables to an email using wp_mail()
I have created a WP template and added to it a form.
Below the form I have added the wp_mail() function to send the data the user has input to their email.
Now, I'm getting notices that:
Notice: Undefined index: name in mypath.
Any help how to…

WeAreDoomed
- 248
- 1
- 14
0
votes
1 answer
Get ACF field values of related group (via Post Object) in functions.php
I have 2 WordPress custom post types: CLIENT and MEASUREMENT
I also have 2 ACF groups: CLIENT and MEASUREMENT
I have multiple CLIENT posts.
When I create a new MEASUREMENT post I can select a CLIENT via a 'Post object field' to set the relation with…

Yorlinq
- 131
- 14
0
votes
1 answer
wp_mail() transforms "-" to "–" in email subject
I am using the wp_mail() to send emails from a custom WordPress plugin.
I am trying to figure out why the emails sent result in some non-alphanumeric characters in the email subject being changed? For example, a subject such as "Word1 - Word2" will…

Jonathan Blakoe
- 11
- 3
0
votes
1 answer
Can we use multiple message fields in wp_mail() function?
I have a code in php and i want to use that code in my wordpress website. I have created a contact form included some field calculations (multiplication/addition) on the client side. But after the user fills the form, user submit the form for mail…

Muhammad Shahid
- 325
- 1
- 4
- 12
0
votes
0 answers
PHP sending issues with wp_mail
I developed under WordPress a page that receives a JSON containing an email address and automatically sends an email using wp_mail.
Here is the code related to wp_mail :
// Not loading WP templates...
define( 'WP_USE_THEMES', false );
// Load…

Kevin
- 13
- 3
-1
votes
1 answer
Wodpress: Change ###ADMIN_EMAIL### only for all notification email
Is there a way to change ### ADMIN_EMAIL ### for all automatic notifications email in wordpress?
For example in change password notification and change email for user, I would like a custom email different form real admin email
If you did not…

Meg
- 11
- 1