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

wp_mail() not sending email in multisite subdomain

I have a multisite enabled WordPress configuration. My main domain is like http://www.example.com, with several subdomains like http://test1.example.com, http://test2.example.com, and so on. I have ...
0
votes
1answer
1k 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:...
0
votes
1answer
752 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
1answer
27 views

Attach pdf from dynamic url

When I save a custom post, I would like to send a PDF by email as attachment. I tried that : function my_custom_save_post( $post_id, $post, $update ) { if( ! $update ) { return; } if( ...
0
votes
1answer
34 views

Warning: include(): https:// wrapper is disabled in the server configuration by allow_url_include=0

I am trying to make a email template for my wordpress site. So I tried to include the HTML mockup that was given to me, but instead of putting it directly on the same file, I would like to include() ...
2
votes
2answers
1k 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 ...
0
votes
2answers
1k 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
1answer
977 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
1k views

How to send email with wp_mail() with from email taken from contact form instead of the host?

I have set up SMTL like this, add_action( "phpmailer_init", "send_smtp_email" ); function send_smtp_email( $phpmailer ) { ini_set("sendmail_from","xyz@gmail.com"); ini_set("sendmail_path","xyz@gmail....
0
votes
1answer
1k views

Pass return-path additional parameter in wp_mail

Our server is currently automatically setting the return path as {serverusername@serverhostname.tld}. When sending an email in PHP, I can override this by doing the following: $return = '<bounce@...
0
votes
2answers
1k 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 ...
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 ...
0
votes
2answers
796 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', '...
4
votes
1answer
6k 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 pre-...
2
votes
2answers
2k 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, ...
1
vote
2answers
937 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
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 ? <?...
40
votes
8answers
21k 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 ...
0
votes
1answer
1k 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
3answers
1k views

wp_mail() function doesn't send email in Ajax mode

When I use the wp_mail() or mail() function in AJAX, the function doesn't work and doesn't send email. When I use these functions simply in my functions.php file it works fine. It's not related to ...
1
vote
2answers
636 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 ...
0
votes
1answer
45 views

wp_mail only sends emails to gmail

wp_mail only sends emails to gmail and i receive emails only on gmail inbox but in dedicated servers couldnt send recieve anything even as spam followed data works well only to gmail ...
0
votes
2answers
2k 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
77 views

wp_mail send multiple emails in a loop

I'm very confused with wp_mail(). Here my code. function email_notification_for_admin_and_customer( $order_data ) { $subject_email = 'Subject LOREM IPSUM'; $customer_email = 'Hi Customer, ...
0
votes
0answers
15 views

Forms: Use predefined values ​if users do not fill out forms

I'm making a form using PHP and HTML. I want the form to use a predetermined value if the user does not fill out the form. Default value: Name: Jhon Email: jhon@example.com Message: Without message ...
0
votes
0answers
34 views

Wordpress & AWS SES : There has been a critical error on your website

I successfully uploaded my elite version WP Elite Mail SMTP As of now, I included my AWS Secret key and other credentials. But the problem is when I tried to send test email using WP Mail SMTP that ...
0
votes
0answers
42 views

How to send a particular csv file as an email?

I have created a function to run a query and create a CSV file. The CSV file will be stored in a particular folder on my server. These files are distinguished by dates. I want to schedule an event ...
0
votes
0answers
14 views

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 ...
1
vote
0answers
24 views

Unable to send custom welcome email after user register

I am trying to send a custom welcome email after user register on our website. The default role set is 'subscriber'. The email should pull some user meta values and display the same in the email. I ...
0
votes
1answer
2k views

wp_mail encode ’ in &rsquo; in subject

I create a function to send mail (in french) for custom post, it's work but subject is encoding in html. I do this : $get_title = get_the_title($ID); wp_mail("me@my.com","new article : ".$get_title,"...
3
votes
1answer
2k 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 ...
0
votes
1answer
1k views

Problem using wp_mail function

I have a form whose message is composed from multiple input fields when submitted. I got this form working as simple php document but when I'm trying to use the form within a wordpress page it doesn't ...
0
votes
2answers
18 views

Notify users only on post publish

I am using this function to notify users when their post is published. However, repeated emails are being sent when the post is updated. I only want to send 1 email when the post is published first ...
0
votes
1answer
404 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
0answers
36 views

Attach base64 images in my html template not working

I am trying to send base64 encoded images in my HTML template but in my email images are broken. Can anyone help me out? email-template.php file <?php // Echo base64 encoded sample image ...
2
votes
2answers
5k 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 ...
3
votes
5answers
81k 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 ...
56
votes
5answers
97k 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: $...
0
votes
0answers
33 views

How to add Cc and Bcc to emails

I am using WP Mail SMTP to connect my SMTP and now I need to add Cc and Bcc to emails, I have no clue how or where to add them. If anyone help it would be highly appreciated.
2
votes
2answers
84 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 ...
0
votes
0answers
31 views

Faster Emails with WP Mail

I'm using wp_mail() to send transactional emails on my website, but it takes very long to process the email. What can I do to speed up this process?
0
votes
1answer
40 views

What is the best way to send out thousands of emails from a WordPress site? [closed]

We are currently using SendGrid API to send transactional emails. This is very slow and it freezes the process. How do you send out 5000+ emails on a WordPress site? We are currently using SendGrid ...
0
votes
1answer
79 views

wp_mail function not working in WordPress Plugin Boilerplate

I am creating a plugin using WordPress plugin boilerplate (https://wppb.me/), I have create a separate file for sending emails under /admin/partials/ directory. but wordpress throw error when I am ...
0
votes
1answer
164 views

Wordpress email could not be sent

I have faced an error while forgetting email password in WordPress link : /wp-login.php?action=lostpassword After submitting email faced below errors: ERROR: The email could not be sent. Your site ...
0
votes
1answer
21 views

Pass Variables or Variable Place-Holder from Editor to PHP

I'm building a method for my client to construct a message content to be sent with wp_mail. Within that I'd like them to be able to choose variables, for example the message might look like this in my ...
3
votes
2answers
450 views

How to set up gmail SMTP in Wordpress

I'm trying to set up an SMTP gmail server to send emails from my WordPress site. This is what I've got in my wp-config.php: define( 'SMTP_USER', 'myaddress@gmail.com' ); // Username to use for ...
1
vote
1answer
1k 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/...
20
votes
3answers
45k views

How to set SMTP 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
0answers
48 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
50 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 ...

1
2 3 4 5
7