Questions tagged [wp-mail]
48 questions
7
votes
2 answers
Set reply-to address in wp_mail header
I use wp_mail to send notifications out of my WordPress theme. How can i add a reply-to address to the follwing wp_mail script:
$recipient = "recipient@example.com";
$headers = array('Content-Type: text/html; charset=UTF-8','From: MyWebsite…

public9nf
- 1,311
- 3
- 18
- 48
3
votes
2 answers
Send both HTML and Plain Text emails using wp_mail in wordpress
I want to send both HTML and Plain Text emails using wp_mail() function in wordpress
I wasn't able to find a way to do that.
Does anyone know how to do that?
In PhpMailer for example there was an option to set both HTML and text with this…

user3718754
- 43
- 1
- 6
2
votes
2 answers
separate resulting values from a foreach with commas
I am saving values with add_user_meta within the same meta key.
What I need is to separate them with commas when getting them with foreach so I can send them by wp_mail.
I need something like this:
1@gmail.com, 2@hotmail.com, 3@gmail.com
but when…

mario
- 47
- 6
2
votes
0 answers
wp_mail() sending only last file from the $attachments array
I'm using wp_mail() function to send an email with multiple attachments. But only the last element of the array got sent.
$attachments = array(
/home/tpoghrfd/site/vcfact/1/8965784_a.pdf,
/home/tpoghrfd/site/vcfact/1/8965784_b.pdf,
…

Py C.
- 41
- 4
1
vote
1 answer
WordPress API REST send mail with attachement send in HTTP request
I'm trying to send an email from the WordPress REST API. This email has some file attached to it, that are sent from a JavaScript front end. I can get the data and the file, but I can't attach those files to the mail, it returns me this error…

n3tx
- 23
- 3
1
vote
0 answers
Woocommerce Sendinblue email changed download url of product
My product is downloadable. I use WP Mail SMTP plugin and Sendinblue to send Woocommerce emails. After payment email is sent with the wrong product download url.
For example:
Woocommerce sends download link…

rokky
- 59
- 6
1
vote
1 answer
Email validation link sent to users on outlook expire due to msnbot
I have created an web app where users have to first register and confirm their email address by clicking a link that contains a validation code;
I recently discovered that users using outlook are getting code expired or does not exist whenever they…

valiD
- 351
- 1
- 16
1
vote
0 answers
wp_mail is returns false when customizing WordPress theme locally
I am customizing a new theme for my wordpress locally. I have form for sending an email.but its not working. When i am trying with below code in my functions.php, i am getting 'email error!' instead of 'email sent…

Devleena
- 453
- 9
- 25
1
vote
1 answer
BCC all outgoing emails wordpress
So I want to BCC all outgoing emails from my wordpress site to two static, hard coded email addresses.
I went to the pluggable.php file and hard coded the BCC headers to the wp_mail() function like this:
function wp_mail( $to, $subject,…

Alejandro Nieto
- 49
- 6
1
vote
0 answers
Upload image attachment and send it via wp_mail
I'm trying to make a form where the user will be able to attach image file and then the image will be send on e-mail as attachment via wp_mail.
Here is what I've done so far:
The code for the attachment button:
1
vote
0 answers
Add attachment to email from contact form submission
I want to receive the file uploaded in my form as an email attachment. At the minute it sends a confirmation email but with no attachment. I think I would need to add it as a string attachment.
e.g
When a user applies for a role on my website, I…

rmiddleton
- 11
- 2
1
vote
1 answer
Mail - \r\n characters visible in recieved email
I'm sending a test email to myself which contain values inserted into a form.
I recieve the email, but the "formating" is all wierd and \r\n is visible. I tried %0D%0A and (although didn't specify that it would be an HTML) as well and it was…

WeAreDoomed
- 248
- 1
- 14
1
vote
0 answers
WordPress: template_redirect hook sending wp_mail twice
I have a few restricted pages. If a user tries to access those, I warn them by email using wp_mail and alert admin with some data such as username, URL, time, etc. For that, I am using the template_redirect hook.
All is working fine but wp_mail…

Code Lover
- 8,099
- 20
- 84
- 154
0
votes
1 answer
Wordpress wp_mail doesn't send emails to mailtrap
I have a multisites wordpress project in local (using docker), and I am using WP Mail SMTP plugin to handle sending emails.
I did configure the plugin with my mailtrap credentials, and everything is fine because I tested it and it worked, I…

Yuu
- 49
- 8
0
votes
1 answer
wp_mail function to send massive emails - problem with placeholders
So far sending massive emails its fine using Bcc
foreach ($users as $key => $user) {
if ($user->roles[0] != "administrator") {
$headers[] = 'Bcc: ' . $user->user_email;
}
}
wp_mail("noreply@test.com",…

Luisana Mora
- 1
- 2