No from address/name specified?

I am using the php mail function for account activation. I have set the From: headers in my code, but when the mail is sent, if I check in the inbox, it shows No from address/name specified. Why is this, and how do I correct it?

You can’t change that, we edit the email when it leaves our servers. You can’t customize that when using PHP mail on free hosting.

So does that mean it will always show no address specified if I use free hosting, and I can never show a different name?

Actually, I just checked your script and I see you’re using the Gmail address as a from address. I’m not entirely sure, but that could explain the issue as well.

Please make sure you’re using a from address under your own domain name. Sending an email from, say, a Gmail address but not sending it from Gmail is a sure way to get your messages marked as spam. Always send messages under your own domain name to prevent the messages from being marked as unauthorized.

Note that you don’t need to have a corresponding mailbox or forwarder for the address.