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
1answer
1k 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
672 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. ...
1
vote
1answer
1k views

Unable to override pluggable function wp_mail

A couple of days ago, my wordpress blog hosted on openshift suddenly stopped sending me mails and notifications. Until now I'd never bothered how wordpress handled mail sending since they always ...
1
vote
1answer
708 views

Using wp_schedule_event to send emails including links

I'm trying to write a simple plugin using wp_schedule_event to send emails. The first example below works fine, but in the second (where I try to include a url within the email) nothing happens. Why? ...
1
vote
2answers
2k views

Why is my get_post_meta always empty

I made this action hook which will send an email to the users every time a new post in the custom post type "events" is made. function email_members($post_id) { global $wpdb; $usersarray = $wpdb->...
1
vote
1answer
4k views

wp_mail: An array as $to - multiple emails or single email with all the email ids in it?

If I will use an array of email IDs for $to parameter of wp_mail function, will it send different emails to all those email ids or will send one email with all the email ids as 'to'?
1
vote
1answer
3k views

wp_mail is sending two emails when used after retrieving session data

I'm using the wp_mail function to send emails in WordPress. Before I run the function, I retrieve a heap of data from a session and some others from a form that was just submitted. For example: $...
1
vote
1answer
1k views

Email notification via WP_Mail on published custom post type

I've been trying to get an email notification to fire when a new custom post type (in this case, "event"), is published. I've tried a few things and settled down to this simple example that, I imagine,...
1
vote
1answer
263 views

3 different mail notifications

I'm building a small tracker and need to send mail notifications on specific actions. Thought-out notifications: Administrator gets a notification email when a new ticket is published Author gets a ...
1
vote
1answer
5k views

wp_mail not recognizing cc and bcc headers

I am using WordPress 3.1.3 I am getting following notices when I use wp_mail with cc and bcc headers. Notice: Undefined variable: cc in /var/www/mysite.info/htdocs/wordpress/wp-includes/pluggable....
1
vote
2answers
19 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 ...
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
1answer
445 views

On form submission how to send 2 email to different users

I have created a custom php form and on its submission email is sent to user but i want to send email to admin as well to keep admin up-to-date about form submissions on website using wp_mail. <...
1
vote
1answer
686 views

wp_mail not sending attachment

My mail function is as follows add_action('wp_ajax_order_processing', 'order_processing'); function order_processing(){ include 'mail-translations.php'; require_once( ABSPATH . 'wp-admin/includes/...
1
vote
2answers
298 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
1answer
732 views

Email Attachment from Form Submit

I am currently encountering a very strange problem. With the help of two existing wordpress functions (wp_handle_upload and wp_mail) and a form that uses some custom ajax functionality to process my ...
1
vote
0answers
578 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
97 views

WordPress unable to send mail

I am unable to get email functioning in WP 4.8. I have WordPress running on a Bitnami LAMP stack. All modules/plugins/themes/languages are up to date. I have an SMTP host that is effectively an ...
1
vote
1answer
2k views

contact form ajax empty response error message

I have two contact forms in my theme, one of them saves the contact information in a custom post and send emails to user and admin, and is working great. The other has to send the email, but not save ...
1
vote
2answers
698 views

How to retrieve the sender email with wp_mail()?

I Have this simple following code : <?php //if "email" variable is filled out, send email if (isset($_POST['email'])) { //Email information $to = get_option( 'admin_email' ); $headers ...
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
1answer
547 views

Not able to send links in email after setting header

I am not able send links in email. I am using wp_mail() function to send email. When i set header $headers .= "Content-Type: text/html; \r\n"; this header removes href attribute in received email. i ...
1
vote
2answers
1k views

Can you set envelope sender used by wp_mail?

Is it possible to change the envelope sender used by wp_mail? So far I have tried setting headers, and the wp_mail_from and wp_mail_from_name filters.
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
1answer
3k views

wp_mail file attachment not being placed in upload folder?

I have a form where I want users to be able to select an image to upload. The image gets temporarily uploaded to the wp-content/uploads folder, is attached to the e-mail and then is destroyed. Right ...
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
1answer
147 views

Website needs to be opened for wp_mail to work

I have a custom post type Events. In that post type, I can schedule events with a date and time. Whenever I publish an event, it will automatically send an email to the users 2 days before the event. ...
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
387 views

Send multiple attachments with JQuery and wp_mail() function

I need to add the ability to have multiple attachments from the input field on my Wordpress site. Currently I used jQuery code to clone the input field and assign new ID and name with increment of 1. ...
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
3answers
139 views

White screen when activating plugin that sends form via WordPress

I am creating a plugin in WordPress that will send some data via email. When I activate the plugin, I'm getting a white screen. I set define('WP_DEBUG', true); in wp-config.php but no error messages ...
0
votes
1answer
2k views

Should I use wp_mail or PHP's mail? [duplicate]

I have an email system that I am making in a WordPress plugin to send the emails with this code: include(PLUGIN_DIR.'config/class_phpmailer.php'); $email = new PHPMailer(); $email->From = ...
0
votes
1answer
690 views

wp_mail not sending in test php file

I created a test php file which exists in public_html. I also copied it to the wp-content folder. All it does is call: <?php wp_mail('myemail@mydomain.com','test','hi'); ?> Neither file ...
0
votes
3answers
13k views

wp_mail not sending emails

I have used WP-Mail-SMTP to setup the mailer on my WordPress installation. I have tested it by sending email to my private mail. I am now trying to send the form data using wp_mail() function[WP]. ...
0
votes
1answer
1k 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
2answers
358 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
2answers
382 views

How dynamically change wp_mail behaviour, sending html or plain text based on conditions?

I have several forms that send mails. Some of the mails should be sent as html, others as plain text. Right now I set the html option like this: add_action( 'phpmailer_init', 'mailer_config', 10, 1); ...
0
votes
3answers
76 views

Stop sending email everytime I updates my post

My draft posts will have custom field which contains value as email address. So whenever I publish the post, it will send email to the user. It's working fine. However, if I updates the post, it still ...
0
votes
3answers
1k views

wp_mail not sending

So I have a localhost WordPress server, and the function wp_mail workd perfectly and sends. When I put the exact same file in an actual WordPress website as a theme, it only shows me a blank screen, ...
0
votes
1answer
3k 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
385 views

wp_mail sending old content from post

I have a function that sends out emails using wp_mail() every time a post is published or updated. However, the content that is being sent is always one post behind. If I update the content the email ...