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

learn more… | top users | synonyms

0
votes
3answers
792 views

Not sure how to debug: Send specific users an email when posts are published

I've got the following code, which is supposed to run when a new post is published for the first time, check if a custom field 'specific_users' has data (this uses Advanced Custom Fields), and if so, ...
-1
votes
0answers
26 views

wp_mail works in one plugin but not another

I wrote 2 plugins, one copies data from one wp site to another and its sends an email using wp_mail() successfully. I tried using the same code in another plugin that imports an xml file into our site ...
0
votes
0answers
34 views

Welcome email specific to user role

I would like to send an additional welcome email to a specific user role, 'freelancer'. WP would still send its standard welcome email, with login and password, to all user roles. I found the ...
-2
votes
1answer
22 views

How to fix WP Mail Function? [closed]

I have a godday Hosting and WP mail is not working with it. Iam facing this problem from couple of days kindly someone suggest me best practice to solve this issue.
14
votes
2answers
265 views

Sending multipart (text/html) emails via wp_mail() will likely get your domain banned

Summary Because of a bug in WP Core, sending multipart emails (html/text) with wp_mail() (to reduce chance of emails ending up in spam folders) will ironically result with your domain being blocked ...
1
vote
1answer
48 views

On user registration, if welcome mail sent, add post with new user as author

I am trying to create a new post (later will convert it into custom post type), whenever a new user register on the website and if the welcome email was sent succesfully. The problem is that I want to ...
10
votes
1answer
365 views

Do something after sending email

I want to do something after WordPress sent an email. For example, after sending "Reset Password" email using wp_mail() function.
0
votes
1answer
30 views

How to send an email using wp_mail and using more than one BCC in the header

I have this code part that's responsible for getting the variables from the contact form - and and sending an email to me, and my friends from work. add_action('wp_ajax_nopriv_submit_contact_form', ...
0
votes
1answer
681 views

how to set from address according to the form input email address for wp_mail()?

I am trying to create form and send it to my e-mail address using wp_mail. my wp_mail() code is: if($_POST["submit"]) { $to="my email"; $subject ="My subject"; ...
0
votes
1answer
2k views

Check to check if wp_mail is working properly?

I'm trying to use wp_mail (testing on local machine) but no mail is received. The php.ini has smtp_port = 25 set and the php mail() is working so far. how can I check if wp_mail is working what can ...
0
votes
3answers
4k views

wp_mail() is not working on server

i am breaking my head from last 1 hour but not getting any idea that what's going wrong with my code... i am developing my own plugin and i am using wp_mail() function for sending mail in that but ...
1
vote
3answers
445 views

Change Default wp_mail From, Without Affecting Gravity Forms

I have a question about changing the default sender From name/email on default wp_mail notifications (e.g., Lost Password response), but WITHOUT it messing up notifications being passed on by Gravity ...
0
votes
0answers
16 views

wpmail in conditional statement in theme template

I am using a theme which uses PostRelations to create courses, lessons and plans. A plan can be set for a certain period such as a month, year etc. The plan expires when this period is over. I am ...
2
votes
1answer
68 views

Comment Email Notification for CPT Comments

I have a WordPress site where users can create new support tickets through submitting a form that posts to a Custom Post Type. I would now like WordPress to email users when there is a comment on the ...
0
votes
1answer
51 views

Sending email to all users

What is the best practice to send an email to a large number of users? I am developing a plugin for the website of an association and one of the things needed is to be able to send an email to all ...
0
votes
1answer
41 views

How to make WordPress emails async

I recently had an issue on my site where emails were failing to send. That was a problem, but the bigger problem was that the failure caused the script to timeout which really put a damper on the user ...
2
votes
1answer
452 views

Adding an Attachment to Contact Form Using wp_mail

Would anyone be kind enough to explain to me how to attach an uploaded file to an email generated using wp_mail? I've built the form but all the questions I can find online refer to attaching a ...
0
votes
0answers
8 views

wp_mail inserting gaps into code at random

Guys I wanted to know if anyone else out there has come across any problems with wp_mail breaking email code. I've noticed it happening in some of my notifications for a while but tended not to ...
0
votes
3answers
107 views

Different Webhost and using Google Mail server: Is there a better way than SMTP?

Currently my situation is the following: I am using Wordpress which handles a few things mail related: Registration forms that send a notification and contact form that send a message. However, ...
0
votes
0answers
37 views

How to stop email from sending when updating and publishing pages not posts

I have a function that sends out emails when a new post is published or updated and is working great until today I realized that it also sends emails when publishing or updating pages whihc is a real ...
2
votes
1answer
66 views

Send an email when custom post type category is changed

This is the first time I've attempted to write an action hook. My CPT has 4 categories. I'm trying to make WP automatically sends an email notification when the category is changed. By change I ...
1
vote
2answers
938 views

How to apply the “retrieve_password_message” filter?

I would like to change the body of the password reset email that WP sends out with something more friendly. I am trying to use the "retrieve_password_message" filter but I am messing it up. Can ...
0
votes
1answer
160 views

wp_mail sending mail twice!

I can't figure out for the life of me why this is sending twice. It's not in any loop, and I have an if statement checking if isset but nothing I do stops it from sending twice. It's a basic form ...
0
votes
1answer
89 views

How to Configure SMTP on wordpress Cant Send Email

I am Currently working on a project in which my only problem is SENDING an email from site to Gmaill yahoo etc. I want to configure the SMTP so I can make Independent Email Sending. My problem is ...
0
votes
1answer
117 views

How to create a CSV on the fly and send as an attachment using wp_mail?

I'm trying to create a CSV file from a form submission and send that file automatically by email to a specific user. The email itself is sending fine, but I can't get the attachment to go through. Is ...
0
votes
1answer
221 views

Why wp_mail() function isn't sending any emails and displaying '0' in Chrome 'Network' response

I'm trying to send emails through wordpress using wp_mail() function and it doesn't seem to work. It's displaying 0 in Chrome 'Network' response with Status Code:200 OK this my code part: ...
0
votes
0answers
48 views

wp_mail links are dead

I am trying to make a pseudo-newsletter type plugin which will email that authors of certain posts. The email sends the contents of a textarea with some extra text added to the end of it. I've sent ...
0
votes
0answers
44 views

wp_mail usage problems

I am trying to include and make use of Wordpress' wp_mail() function within my functions.php file to send email out from a contact form on the front-end. However, no matter what I try I keep getting ...
0
votes
0answers
96 views

Help with contact form

Ok, first of all, this is going to be a huge amount of code. Sorry for that. I am not finding a way to make this contact form on my theme work. Here is the form itself: <!-- Contact Section ...
0
votes
0answers
24 views

wp_mail_from: different from address each time

I have a form. Where user gives their name and email address. The I use the custom plugin to send the mail. The requirement is I need to send the mail on behalf of the user who signed. Now in wp_mail ...
1
vote
2answers
104 views

How to send mail to subscribers using wp_mail

I'm just starting out with making plugins and I'm trying to make a simple one that will mail a notification to subcribers whenever i make a new post so far i have add_action( 'publish_post', ...
0
votes
0answers
42 views

Attached file are broken wp_mail

On my local when I use the wp_mail() with attached files it works, but when I'm on prod it doesn't. The file I receive in the email is a .dat file. I read that it's because there is a transmission ...
1
vote
1answer
174 views

Can I configure WordPress to use postfix without a plugin?

I am developing a WordPress site on a vagrant box and have installed postfix in order to test email notifications. At this guest OS (Ubuntu) level, I am able to end a test email: echo "Test mail ...
0
votes
1answer
60 views

wp_mail sending old content from post

I have a wp_mail function that sends out emails everytime a post is posted or updated, however the content that is being sent is always one post behind. So if I update the content the email sends the ...
0
votes
1answer
190 views

wp_mail() won't send mail when it's a variable, only when hard coded

I have coded a "follow post" script to which I wanna add the functionality of sending the user an email if a post they have followed has been updated. My script only sends an email if I hardcode an ...
3
votes
2answers
126 views

Using wordpress templating for html emails

Im working on a plugin that needs to send out an email after a form submission. Im using wp_mail for this, and it works perfectly fine. My problem is that in my code the html is generated by a bunch ...
5
votes
2answers
9k views

Is there a way to send HTML formatted emails with Wordpress' wp_mail function?

Is there an action_hook or something similar that could help me achieve this? I tried adding markup in a PHP string variable and just fired off an email with the wp_mail function like so: $email_to ...
0
votes
0answers
9 views

Contact form not working in wordpress [duplicate]

I am creating a wordpress theme for my website in which there is a contact form in index.php. For my contact form i am using following code. However, it's not working as expected. It's working fine in ...
4
votes
5answers
19k views

Wordpress refuses to send mail, “…your host may have disabled the mail() function”

I recently implemented a comment area on my website and tried to get the email notification functionality to work. It doesn't seem to want to send email notifications when new comments are made. Just ...
0
votes
0answers
78 views

Send attachments via wp_mail from temporary folder

Is it possible to send attachment via wp_mail, using temporary file, instad of uploading them to any actual folder on server? For example: <input type="file" name="file"> $attachment[] = ...
5
votes
2answers
13k views

What's the easiest way to setup SMTP settings programmatically?

Assume we have blank WP site and we want to setup SMTP settings programmatically in our plugin or theme. What's the easiest way to do it without changing core files?
0
votes
2answers
93 views

What is the most efficient way of implementing a notification system? [closed]

I am about to start implementing a notification system for my site and would like to know what performance measures I need to take into account before developing it. I need to make this for a large ...
0
votes
1answer
90 views

How to send language string in email message body

I am using wp_mail() function to sending email. I have one static string "Hello Admin". My clients wants convert this string to language string. So it possible to convert static string to language ...
0
votes
0answers
103 views

wp_mail() header From is not working

I created a contact form for my website which works fine except for one thing. The From header is not working correctly. Instead of using the $contact_name it uses my domain name as the name. I have ...
0
votes
1answer
277 views

wp_mail - using a custom field value

Can this work? I want to send a email when a post is published to the recipient, that is called in custom field. EDIT I changed the code to another example I found. function ...
1
vote
1answer
91 views

Email Post Attachment on wp_insert_post Action

I have a frontend form that uses wp_insert_post() to programmatically insert posts into the site with "pending" status. I'm also using insert_attachment() to attach the submitted file to the post. ...
0
votes
1answer
170 views

wp_mail BCC admin

This code does exactly what I want, but I want to add the username of the author of the post. // BCC Admin if (get_option('jr_bcc_apply_emails')=='yes') : wp_mail( get_option('admin_email'), ...
0
votes
1answer
216 views

Wordpress ajax success response

I'm trying to create a contact form in Wordpress using wp_mail and ajax The emial works but I'm having problems with the ajax success reponse. After the email is sent I need to show the user a ...
1
vote
1answer
951 views

Error when requesting password reset email - wp authentication

I get the following error whenever a user tries to request a password reset email: The e-mail could not be sent. Possible reason: your host may have disabled the mail() function. As per ...
1
vote
0answers
86 views

wp_mail 200 response but no mail sent

I'm trying to send email from WP using ajax to validate the form and wp_mail to send the mail. The form is a basic form with id names on the fields The js validtion looks like this ...