Questions tagged [wp-mail]

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

93 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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. ...
3
votes
1answer
1k views

Postman: wp_mail has been declared by another plugin or theme

I need use Postman for sending email using an SMTP server, but when installed, it shows this message: Postman: wp_mail has been declared by another plugin or theme, so you won't be able to use ...
3
votes
1answer
1k views

How to allow specific extensions and file size to wp_mail attachment?

I am trying to create a form with an attachment option that will be sent to an email when the form is submitted on a wordpress site. My codes work fine and it sends email in a HTMKL table format to ...
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
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 ...
2
votes
0answers
223 views

Unexpected = (equal sign) characters in wp mail

I have created a custom form for user registration and a custom html email when someone registers. $headers = 'From: test<ttest@test.org>' . "\r\n"; $subject = 'Test Subj'; $msg=''; $msg .= '...
2
votes
2answers
742 views

Processing a subscription form with POST method?

I am trying to integrate a ‘subscribe to newsletter’ feature on my wordpress blog Users just need to enter their name and email address, hit subscribe. This is then supposed to send me an email and I ...
2
votes
2answers
1k views

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, ...
2
votes
2answers
79 views

How to email user after inserting the username in database in WordPress

I have following piece of code, which inserts usernames and other details of users in the database. After inserting the usernames I want to email them using wp_mail();. I am unable to do so. How can I ...
2
votes
1answer
791 views

wp_mail isn't making the from header correctly

So I've got a couple of different plugins which I'm attempting to change the from address of the email header. I've tried using the filters, but it's simply sending the email as the admin user ...
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 ...
1
vote
2answers
293 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 ...
1
vote
0answers
576 views

Using wp_mail() function outside of WordPress and through PHP CLI

I am developing a simple PHP script that will send emails to users. The script is located outside of WP directory and its run through a cronjob. Example cron job call: php /PATH/TO/SCIRPT/script.php &...
1
vote
1answer
295 views

How to make a stand-alone button to the post edit view

I'm looking to add an option to my pages that will allow the user to send out notifications that the post has been added to a subscribe list when they click the button. I want the button to be on ...
1
vote
0answers
446 views

wp_mail() headers multipart/alternative

I am trying to send email via wp_mail() containing both plain text, as well as HTML body. When I am setting up headers like this: $headers = "MIME-Version: 1.0 \r\n"; //$headers .= "From: Dawid ...
1
vote
0answers
388 views

wp_mail attachment woes!

Evening all, Been banging my head for hours, tried a dozen posts about this but still can't get my image to arrive my email!! My form contains this... <input type="file" name="file" id="file">...
1
vote
0answers
292 views

Wp mail does not work when Ajaxed to

I tried to including wp-load, but the wp mail refuses to work when it is called from an ajax hooked function. How can I work around this? Also, on another note, the parameters I sent through AJAX to ...
1
vote
0answers
343 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 $(function(){...
1
vote
0answers
469 views

wp_mail() inside AJAX handler never returns

We have an AJAX handler called by jQuery.ajax() that takes a document stored on the server and mails it to the user. At the bottom there is a call to wp_mail like so: $status_wpmail = wp_mail($...
1
vote
1answer
30 views

Emailing passwords: Setup installed on home server using XAMPP

I've just delved into the WP world and all in all it's going quite well. I have a server at home that I'm using to host the sites. All is working fine except the password emails are not being sent ...
1
vote
0answers
356 views

wp_mail not sending when attachment

I'm searching for an hour and my problem is this : I have the following code : //This is an absolute path $attachments = array( $path ); $headers = 'From: My Name <'.$email_expediteur.'>' . ...
1
vote
0answers
335 views

How can I replace Email addresses with BitMessage Addresses througout wordpress?

BitMessage (bitmessage.org) is a peer-to-peer email system kind of based on BitTorrent. By itself, this software and its' messages are not compatible with email, so in order to send an email to a ...
1
vote
2answers
2k views

Mail function is not working

My mail function is not working. When I submit form it says mail sent. But not receiving. I tried echo if the mail sent. It is also working. What is the issue here? Anything with mail function ? <?...
1
vote
0answers
89 views

Trying to get author'email for sending email from single.php page in wordpress?

I am trying to get author's email in order to send a email form single.php page in WordPress. Actually I would like to get output in quotes in order to send email with wp_mail function. Right?? Here ...
1
vote
0answers
404 views

Google Apps SMTP for WP MultiSite?

How can you force WordPress MultiSite to send all emails via a Google Apps SMTP server? I have attempted to use Easy WP SMPTP, however that does not work exactly as I'd hoped, not to mention it fails ...
1
vote
0answers
453 views

wp_mail works with add_action('save_post', …) but not an ajax action

I have two actions. One is after saving a post, so add_action('save_post', 'on_any_post'); I have a second action triggered via AJAX, so add_action( 'wp_ajax_nopriv_saveTaskPriority', '...
1
vote
1answer
1k views

Send bulk emails without timeout

I am developing a plugin that sends emails out to users. I am having difficulty in finding the most performance enhanced way to send these emails out and prevent a server timeout. In other words, I ...
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
36 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
26 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: <...
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
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 ...
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
164 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 ...
0
votes
1answer
108 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
229 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
51 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
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
2answers
721 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
421 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
547 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
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
100 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 ...
0
votes
1answer
177 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
42 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 ...