My wordpress settings email is contact@domain.com. When I search my entire database for the email of wordpress@domain.com, it does not exist.

Yet my registration emails are still sent from wordpress@domain.com for some reason.

The only thing I can think of is that when I look in my wp_users table, I have no user with the ID of 1. I believe this is the default admin ID. I’m not sure who did it or when, but I think the default admin was deleted a long time ago and I just made my username admin. Perhaps if wordpress doesn’t find an admin email, it automatically goes to wordpress@?

I’m confused with this one.

2 Answers
2

Ok, then you can try this
You can set the header, just not with a parameter. WordPress uses “hooks” and the hooks you need are ‘wp_mail_from’ and ‘wp_mail_from_name’ hooks.

Here are the hooks you might add to your theme’s functions.php file to modify the “From:” header when using wp_mail() to the email address Greg j :

add_filter('wp_mail_from','yoursite_wp_mail_from');
function yoursite_wp_mail_from($content_type) {
  return 'abc@example.com';
}
add_filter('wp_mail_from_name','yoursite_wp_mail_from_name');
function yoursite_wp_mail_from_name($name) {
  return 'Greg j';
}

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *