Are you supplying a return e-mail registered to that domain? If not, some hosts block the mail, e.g. if your domain is www.example.com and your return address is [email]me@jackspit.net[/email], then the host may block it. They try to discourage spammers and jackers.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Have you tried commenting out your original code and replacing it with a hard-coded version?
$sendmail = mail('nobody@yoursite.com', 'hello', 'hello world this is a message', 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@mysite.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion());
does this work?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Like I mentioned in the first post, it's possible that your host has a block on mail() without a registered email to the hosted domain. Eg. I have a few accounts on Streamline.net and this is their policy:
Streamlinenet filters all outgoing e-mail. These must have a 'From' or 'To' address that is a domain hosted with Streamlinenet. Any e-mail not fulfilling these criteria is stopped.
If you are sending e-mail to a customer who has given you their e-mail address, you need to use the domain name of their site (but it does not need to be a valid mailbox, for example [email]noreply@their-domain.co.uk[/email] is a fairly common one to use). If you want the customer to reply to the e-mail you must use a valid account.
Streamlinenet's SMTP Filter System limits the outgoing mail from a domain to prevent bulk e-mailing. The limits are set to allow normal form based e-mail activity to pass unhindered, but stop any persistent attempt to send bulk mail.
Check with your host if they have a similar policy.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Off-topic for ardav - If you post by mistake, just click on "Flag Bad Post" and type reason like "Double post", "Post by mistake" and one of the moderators will take care of it
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902