Please UseCodeTags . Code is difficult to read. You can edit your post to include them using the button or re-post the question with proper formatting.
If it works in the local system, there's a chance that one of the remote mail servers is rejecting the mail. See if you can get a look at the logs for those servers.
Often the most important part of the news is what they didn't tell.
Of course, I found a very beautiful couch. Definitely. And this tiny ad: