niche Posted July 13, 2012 Share Posted July 13, 2012 (edited) I need to have my emails received as being from Niche. It seems I can change the from to anything a long as it has an "@" in it as in: $headers = "From: this@from_me.com\r\n";$headers .= "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed; boundary=\"$bound_text\""; However, like I said, I need to be received as just plain Niche, but this doesn't work: $headers = "From: Niche\r\n";$headers .= "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed; boundary=\"$bound_text\""; Why is that? Edited July 13, 2012 by niche Link to comment Share on other sites More sharing options...
justsomeguy Posted July 13, 2012 Share Posted July 13, 2012 Because it's not allowed by the RFC. Check the note for the to parameter on the manual, the formatting of the from address follows the same rules: http://www.php.net/manual/en/function.mail.php Link to comment Share on other sites More sharing options...
niche Posted July 13, 2012 Author Share Posted July 13, 2012 Shifting gears a little, how do I get rid of the ampersand in my inbox summary? I get emails all the time from Facebook and all that shows in the summary is "Facebook". By summary, I mean the screen with the headers: From, Subject, Received, etc... Link to comment Share on other sites More sharing options...
justsomeguy Posted July 13, 2012 Share Posted July 13, 2012 You would probably need to look at the raw headers from those emails to answer that. Your email client might be treating emails from Facebook or other places differently. Link to comment Share on other sites More sharing options...
niche Posted July 13, 2012 Author Share Posted July 13, 2012 How do you look at an email's the raw header? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 13, 2012 Share Posted July 13, 2012 Several email clients would let you do that. You could even use a PHP script to check the account and save the raw messages somewhere. Link to comment Share on other sites More sharing options...
niche Posted July 13, 2012 Author Share Posted July 13, 2012 I'll have to come back to this. Thanks justsomeguy. Link to comment Share on other sites More sharing options...
Guest So Called Posted July 13, 2012 Share Posted July 13, 2012 You changed the topic to solved but I don't see the solution. Not sure if you gave up but if not I feel that others reading this topic deserve the correct answer: $headers .= "From: \"Niche\" <somebody@example.com>\r\n"; Actually I think the \r is superfluous and is ignored. And pardon me if the correct solution is posted but I didn't see it. My reading comprehension seems to be getting challenged these days. 1 Link to comment Share on other sites More sharing options...
niche Posted July 14, 2012 Author Share Posted July 14, 2012 You didn't miss anything. I thought the topic had gone as far as possible. Obviously not. That's hitting the nail on the head So Called. Thank-you. Link to comment Share on other sites More sharing options...
Guest So Called Posted July 14, 2012 Share Posted July 14, 2012 I faced the same problem myself, in my contact form. I knew it could be done because I saw others do it. I both copied them (by looking at my email headers) and I read the RFC. It worked. One thing for sure. If somebody else can do it then you can too. Only question is figuring out how they did it. Link to comment Share on other sites More sharing options...
niche Posted July 14, 2012 Author Share Posted July 14, 2012 Thanks for the encouragement on the RFC. Something written in 1996 can't be that horrible. Link to comment Share on other sites More sharing options...
Guest So Called Posted July 14, 2012 Share Posted July 14, 2012 Some of the RFCs are very out of date, but they offer an insight into what was originally intended and what was the accepted standard until developed further. I recall reading the email RFCs a dozen years ago, and then using TELNET to access SMTP and POP3 servers to see directly what the transactions were. Today it's sometimes a bit harder since some of the servers hang up within a few seconds if you don't respond, too quickly to think about it and type a response before timeout, at least some of them. It may still be possible to find a patient email server. But don't be surprised if they refuse to talk to you if you're not in their domain. Most ISPs refuse to accept SMTP connections if you are not in their domain and are not a recognized major mail relay. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now