I have a website that is hosted by GoDaddy on a virtual dedicated platform, and I haven't been able to get the
mail() function to work properly in my PHP script. I'm trying to send emails with validation codes to people when they first sign up to my website, and the
mail() function works great for Gmail address, but not others like AOL or even GoDaddy's email service!
I tried talking with multiple GoDaddy support reps but they weren't really helpful on the issue. I've looked around online and it seems like this is a very common problem with people who are hosting their websites on GoDaddy. I'm not getting bounce back emails when I the emails fail so it's hard to know what's going on

Here is my PHP code:
$sendtoemail = '[email protected]'; $emailsubject = "Please validate your email"; $emailbody = "Validation info, blah blah $emailheader = 'From: [email protected]' . "
" . 'X-Mailer: PHP' . "
" . 'Reply-To: [email protected]' . "
" . '[email protected]'; mail($sendtoemail, $emailsubject, $emailbody, $emailheader);
I've gotten a few errors when I checked
/usr/local/psa/var/log/maillog (accessed through PuTTY SSH) that all ended in:
deferral: ./Maildir:_No_such_file_or_directory/
I have also activated reverse DNS on my hosting account and created an SPF DNS record thatemail through "GoDaddy only" and checked the "Include PTR" box for DNS lookup. This was under the "TXT (text)" section of the "Zone File Editor" on GoDaddy's DNS manager. (Hopefully that makes more sense to you than it does to me).