plugins – wp_mail in pluggable.php returns the original settings

My server did not provide the correct return path in the source header when WordPress sent an email, causing me to be blacklisted.

I fixed this by adding this string to wp-includes / pluggable.php and know that this can be overwritten in updates, so I'll create a plugin for it later and just include it in the plugin

What I don't understand is that WP hasn't even got my fully qualified domain name. It looks like it got my hostname but not the full hostname -f full name. Force Instance Typically localhost.localdomain is a default host and WP has got virtual.localdomain and my FQDN starts with virtual. *

The email specified which email is in the general settings, but in the source header the email was created with the return path username@virtual.localdomain.

The username was not even a user in WP. It was a Linux user that I use as an administration for this virtual domain.

This is for my own curiosity and understanding. Where does WP get this from? I couldn't track it …

How can I customize WordPress in sent emails using the wp_mail feature?

I create a contact form on the WordPress site.

The form works perfectly with the following code:

//validate email
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
my_contact_form_generate_response("error", $email_invalid);
else //email is valid
//validate presence of name and message
if(empty($name) || empty($topic) || empty($message)){
my_contact_form_generate_response("error", $missing_content);
else //ready to go!
$sent = wp_mail($to, $subject, strip_tags($message), $headers);
if($sent) my_contact_form_generate_response("success", $message_sent); //message sent!
else my_contact_form_generate_response("error", $message_unsent); //message wasn't sent
else if ($_POST('submitted')) my_contact_form_generate_response("error", $missing_content);

However, this sends emails named "From" as "WordPress."

I'd like to customize "WordPress" with the sender's name, which I use the variable "$ name" to let me know who sends me e-mails without opening them.

Every help is appreciated.

Features – How to Fix the Mail Issue wp_mail ()

To fix the e-mail problem with wp_mail (). The hosting of is very bad at this problem. I asked more than four of them for help, but nobody gave me the answer. I have just installed the WordPress in my domain Everything is new, but I do not get this message when I use the wp_mail () function. EX, if I forgot my password.

Enter image description here

The problem is that I had a WordPress installation in this subdomain: That's where the email worked, and I thought it was time to start over in the main domain. I deleted the subdomain and everything and started a new WordPress in the main domain, but the e-mail did not work. So I deleted the WordPress from the main domain and restarted it for the second time in the main domain, but the problem is still there. I find the solution in WordPress StackExchange, so why I'm asking you.

php – wp_mail () does not work while mail () works

wp_mail () does not work while mail () is working. If the order is placed and the order confirmation email is not received, "Request Timeout" is always displayed. The processing of this request takes too long. The server has timed out. If the time limit is not exceeded, please contact the administrator of this website

I checked the core file class-phpmailer.php in WordPress.

I want a mail sent with wp_mail ()

I have increased the SMTP timeout with the following code
add_filter (& # 39; wp_mail_smtp_custom_options & # 39 ;, & # 39; smtp_timeout & # 39;);

Function smtp_timeout ($ phpmailer)
$ phpmailer-> Timeout = 30;
$ phpmailer-> timelimit = 60;
return $ phpmailer;

The problem still exists. No e-mail is sent and the timeout error is fixed.

attachments – Attach an external file as attachment with wp_mail

I'm trying to attach an external file link (doc file) as an attachment, but this can not .. no attachment is attached.

$ email_attachement = array (& # 39; https: //');
wp_mail ($ admin_email, $ email_subject, $ email_message, $ headers, $ email_attachment);

Please help, I'm stuck