A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
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
181 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
112 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
135 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
241 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
53 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
2answers
325 views

Cron not sending wp-mail()

I have a problem with a cron schedule function, it does not want to send an email with the wp_mail() function. This is my code: It is placed in the functions.php <?php add_filter('...
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
1answer
55 views

Adding a button to send email to a user in WordPress Admin Users table

I would like to add a button for each user in the user page in wordpress admin area that will send an email to that specific user when clicked. The code adds the action link "Send Verification Email" ...
0
votes
2answers
745 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
434 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
90 views

phpmailer_init ignored on REST calls

For testing purposes I've set up a mailtrap (dummy SMTP server) to catch all mail in and out of my local site. To do so, I hooked its configuration in the theme's functions.php like this: function ...
0
votes
1answer
574 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
138 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
182 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
354 views

Retrive acf fields in publish_post action for wp_mail

I have a custom post type called "Envios". In it I've created a Custom Meta box which allows to select users and posts. When one of this custom post types is published it sends an email to the ...
0
votes
1answer
102 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
184 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
44 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 ...
0
votes
1answer
33 views

Different query result on local and server

I create plugin to sent list post yesterday and today via wp_mail() to member from WordPress multisite, at localhost the result of list post delivery successful. But at live server, the result of ...
0
votes
1answer
13 views

Email me when front posting or update post

In my site, users can submit post at front-end. And I want to be informed by email when users submit or update post. I searched some codes about this. I'll use wp_main function. function ...
0
votes
0answers
404 views

Send data URL string as an attachment in wp_email

We have a data URL string of PNG image file here and we can pass it via AJAX to a PHP function via button click. Now is it possible to convert it back as image file and add as an attachment to ...
0
votes
1answer
74 views

How to send the checkbox value to email

HTML of form is given below <?php for($i=$start;$i < $end ;++$i) { if($emails[$i]!=""){ $userId=$emails[$i]['...
0
votes
1answer
381 views

Multisite - SMTP not working on other network sites

I have WP Mail SMTP plugin setup on multisite, the email is sent from the parent site successfully, however, when trying the same or another email from the child site gives me following error: ...
0
votes
1answer
24 views

wp_mail doesnt work inside transition_comment_status

I need to send a notification for a visitor whose comment has been published. I created this function to do it: /************************************************* ** COMMENT APPROVED HOOK ************...
0
votes
2answers
526 views

wp_mail() not sending emails with ajax

I am using wp_mail() to send email using ajax. My mail code is as follow. add_action( 'wp_ajax_send_confirmation_email', 'wpse_sendmail' ); add_action( 'wp_ajax_nopriv_send_confirmation_email', '...
0
votes
1answer
257 views

wp_mail sends email twice inside function updated_postmeta

I made a custom function so when postmeta updated to a specific value I send custom email use wp_mail(). Email sends successfully, but it creates two at the same time. Here my code: function ...
0
votes
1answer
210 views

Filter wp_mail based on content type

I can current filter the content type of the wp_mail function: add_filter( 'wp_mail_content_type', function( $content_type ) { return 'text/html'; }); And I can filter the message content ...
0
votes
0answers
118 views

wordpress wp mail not changing sender mail

im using wp_mail to create contact page my email var is $subject = 'hello'; $html = 'message here'; $admin_email = 'admin@yahoo.com'; $email = 'email@yahoo.com'; $headers = array('Content-Type: text/...
0
votes
1answer
76 views

wp mail smtp earlier version

Dose anyone have an earlier version of the plugin wp mail smtp? It doesn't work when I update the plugin. Send the earlier version to my email admin@cding.xyz will be appreciatted. Thanks in advance!
0
votes
1answer
113 views

Custom Fields with add_post_meta()

I have "inherited" an event-booking WP plugin and for some reason (apparently, after moving the website into another location of the same server) this is now the situation: As expected, new ...
0
votes
0answers
271 views

WP_mail() Issue. Duplicate emails if $_GET['A'] == email

I have been scratching my head since last few hours. But still not able to find the cause of the issue. I have created a wp_mail() function which is as follows: if( !empty( $_GET['A'] ) && !...
0
votes
0answers
327 views

How to use Contact Form 7 to handle the server side mail() only?

How can I use Contact Form 7 to do the mail() server side only and I handle the client side myself? I have this form that uses Zurb Foundation to validate the submission: <form class="form-...
0
votes
1answer
23 views

An old plugin self-made stoped sending mail

I have a old plugin running that let people pick products and then sends a mail to the store that is selected. But for a while now it has stoped sending the mails. I guess something in the code is out ...
0
votes
1answer
88 views

Multisite + wp_mail - Route Via Site Conditionally

I'm using a multisite and would like to send emails via specific/conditional sites. My use case: On save_post... a) send email to User A of Parent Site 1 b) send email to User B of Child Site 2 I'm ...
0
votes
2answers
1k views

Adding action item to admin users table and sending email

I'm trying to add a link to each item of the Users table in the WP Admin area and use that link to send that specific user an email. I'm most of the way there but I'm having some odd behavior that I ...
0
votes
1answer
69 views

wont add form details to database or send me mail

My order form stopped working ...it doesn't inserting data into the post-type orders as it should nor does it send me the email...i am using the plugin wp-mail-smtp to get it to send me the mails once ...
0
votes
0answers
254 views

wp_mail sending emails in triplicate

I'm using wp_mail() in a page utilizing insert_php. I'm constructing the mail with no extra headers, just a to email address, a subject and a message construct: wp_mail( $to, $subject, $message ); ...
0
votes
1answer
61 views

adding Recipient to wp_email() is not working?

I am literally tearing my hair out on this. Why won't it send? I think there is something about $recipient from a $var value that I'm just not getting. The same line items are used to create a post ...
0
votes
1answer
648 views

Whitelist email sent by Wordpress

What need users to put in the whitelist of their mailbox to prevent WP generated mails to end up in spam? Say the server use something like that: wp_mail( 'someone@example.net', 'The subject', 'The ...
0
votes
3answers
208 views

Is wp_mail plugin territory?

I recently stumbled upon this and was wondering if calling wp_mail() in a theme is allowed or not as per WordPress standards. I should clarify that I'm not overriding it as a pluggable function in the ...
0
votes
1answer
1k views

Sending email with wp_email and AJAX

New to WP and PHP: I'm trying to send an email with AJAX. My wp_mail is returning true and I'm receiving no errors on GoDaddy where I'm hosting, but the email is never actually received. Here's my ...
0
votes
1answer
283 views

WP Mail isn't sending user account messages, does send from plugins

I'm running WP 4.6.1 and can't seem to send out any user account related emails. Specifically, notify user their account is created (the option is checked when creating accounts in the admin) and ...
0
votes
0answers
313 views

Asynchronous emailing

Whenever a user performs an action involving sending out email notifications, it takes a long time to process and therefore the user must wait a few seconds until the resulting page is loaded. As a ...
0
votes
2answers
878 views

wp_mail doen't send mails whit attachment

On my site I hava two forms witch send email. The one whit no attachment needed is sent correnctly, but the other ony witch has an attachment does not get sent. I am using SMTP config whit Postman ...
0
votes
0answers
115 views

Problem with `wp_mail()`

I have researched a lot and I can not do this plugin to send mail when it comes in step 2, which displays more options form. In the first stage it correctly sends the name and email to the database, ...
0
votes
2answers
1k views

How to display image in mail header using wp_mail()

How to display image in email header. I tried below, it in gmail it is not displaying the image. Please any one help me to resolve this. Thanks in advance. $to = $_REQUEST['userEmail']; $...
0
votes
1answer
904 views

Send email daily using `wp_mail`

I want to send email daily 12:54pm using wp_mail function, but it send mail continuously. Plz suggest what is wrong? <?php $timeg = date( 'g:ia', current_time( 'timestamp', 0 )); $timem = '12:...