Kirk Ward
Expert
Friendly Neighbour
Member Likes (0)
I added this line to my wpmu-functions.php file at the end of the newuser_notify_siteadmin function
$headers = 'From: Calvin Micklefinger <calvinmicklefinger@hotmail.com>' . "\r\n\\";
wp_mail('kirk@mydomain.com', 'subject', 'message', $headers);
I would have expected that as simple as that is, the email "From" would have said
Calvin Micklefinger <calvinmicklefinger@hotmail.com>
As limited as my coding skills are, I really don't see much choice for any other response.
What I got was
"accountingpractitioner.com" <calvinmicklefinger@hotmail.com>
Why in the Sam Hill is that happening? Where do I look to find a solution? This is also disrupting a very solid and well respected plugin I use.

Responses (16)
Lead Developer (joined May 2009) Likes (0)
Did you try just using a plugin to filter the from name/email?
Member (joined February 2010) Likes (0)
Not sure what you mean or what a filter would accomplish.
My goal is to send an email to my autoresponder to subscribe the new user to a campaign series as soon as their blog is activated.
No one has been able to suggest a method.so I am trying to learn and I figured the best place to do it would be to do it at the same time as the admin notifications are sent.
Tried copying that notification and duplicating it, but I didn't get a second email. At least using this I got an email.
Got any suggestions?
Lead Developer (joined May 2009) Likes (0)
You can do it via plugin tying into the 'wpmu_new_blog' action. Though you will have to figure out the wp_mail header issue still at least you won't be modifying core files. There is an example in the antisplog plugin.
Member (joined February 2010) Likes (0)
While waiting for my hosting company to respond, I did a bunch of Googling ... not knowing what the words meant. I kept running across the word filter, wp_mail_from and wp_mail_from_name
In that confusion, I wound up looking at stuff I did not understand, but wound up in the midst of pluggable.php and reading a thread at http://core.trac.wordpress.org/ticket/12851 which discussed the filter in pluggable.
Can you explain those things to me and if they are causing the name to be changed?
Cheers and Cheerios
Member (joined February 2010) Likes (0)
Addendum ...
I also found this thread here at WpmuDev ... http://premium.wpmudev.org/forums/topic/modify-the-from-section-of-email-sent-by-wpmu-to-the-user-when-a-blog-is-created
While it is not the same as what I am wanting corrected, I believe this relates to my problem,
Any suggestions for a solution here?
Lead Developer (joined May 2009) Likes (0)
tie into the filters does that not work?
Member (joined February 2010) Likes (0)
I have no clue how to tie into filters or what that even means.
Clue?
Lead Developer (joined May 2009) Likes (0)
http://codex.wordpress.org/Plugin_API#Filters
Member (joined February 2010) Likes (0)
http://codex.wordpress.org/Plugin_API#Filters
Aaron, old buddy, old pal, can you say "That's all Greek to me"? I am still totally lost. Guess it's time to shell out money to correct what appears to be a WPMU feature (or bug). Money which I doesn't got. That's so sad. Sob.
Member (joined April 2009) Likes (0)
@Kirk Ward, would this plugin be of help to you: http://wordpress.org/extend/plugins/wp-mail-smtp/ and I believe there is another one on this site called Cimy Swift SMTP.
Member (joined February 2010) Likes (0)
@joshmac - I had been looking for that plugin to try. I will report back as yea or nay.
Member (joined February 2010) Likes (0)
@joshmac - Thanks, but it only allows an admin to set the defaults. What I need is for WPMU to allow emails to be sent with the "from" address formatted to identify the actuall submitter.
Think of an application such as a "Contact Form," or one of those spammy "Tell A Friend" applications where the email goes out with the name entered into the submission form.
Lead Developer (joined May 2009) Likes (0)
As I said there is a perfect example in the antisplog plugin source. You can copy that into your own mu-plugin. Then maybe this will help with the header:
http://codex.wordpress.org/Function_Reference/wp_mail
Member (joined February 2010) Likes (0)
Hi Aaron,
That post is where I found the code I used in my original post to this thread.
I have looked at the anti-splog.php file and tried to understand it. There are two instances of wp_mail, and I do not understand them beyond the code I used in the original post. I used the second one as my model when I copied the code from the coex post.
I don't want to waste any more of your time on a singular need (mine alone). Best I find a coder who knows how to do stuff ... I sure don't feel qualified to even follow instructions.
Oh what a poor lost soul. Wailey, wailey, wailey.
Member (joined February 2010) Likes (0)
Use mail() instead of wp_mail()
Member (joined February 2010) Likes (0)
This all got started because if a contact form I was trying to use. I had not been able to get one to work as well as the "Fast and Secure Contact Form" by Mike Challis. However, I wanted the email to identify the sender in the "from" portion of the header and the WPMU filters were blocking this.
Last night I advised Mike of the WP Trac regarding this issue and he modified his code to include filters to handle the wp_mail problem. While it is specific to his implementation, I am including some of the code he changed in the hope it will benefit others.
Become a member