Firstly, your $email_message looks weird. There should be a blank line after the final header line. So after the "From" line, but before the "First name" line, leave a totally blank line. Not even any whitespace characters on it. That certainly could be causing issues; fix that first.
If that doesn't help, you state two different issues in your question which might seem the same, but very much are not:
If people are not receiving emails, it doesn't mean that they were never sent out. They could have been sent but lost somewhere along the way to the user's inbox, perhaps dropped by an overzealous spam filter.
You want to check your outgoing mail server log files to find out if the emails are being sent or not. That log may also have some useful information about the status codes the recipient's mail server has responded with.
If my first suggestion didn't fix things, and there's no clues in the mail log about what went wrong, then I would suggest the most common explanation is that your mail is being filtered as spam, so fixing that would be a good thing to attempt. Look into configuring your mail server to add DKIM headers to outgoing mail, and put DKIM and SPF entries into your DNS.
Oh, and by the way, your check to see if an email address is valid is pretty bad. It rejects bob-smith@bobs-furniture.com.
In reply to Re: sendmail working for me but not another
by tobyink
in thread sendmail working for me but not another
by kickingchicken
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |