Send legitimate emails from script

I need help sending emails from a script that will be recognized and accepted by email accounts. Right now, I’m using the standard mail() function with a return address of a non-existent email address. If there’s a way to make these emails more acceptable, specifically to an AOL mail account, I’d like to hear it.

Oh, and I’m not a spammer. A spammer would just buy whatever software he needed instead of writing his own. (I don’t sell to spammers, either.)