Stop Bounces When Piping an Email to a Script

Recently I built a script to send sms messages from an email. This was to help me monitor my servers. However everytime I sent an email I got a bounce. I tried a lot of different things to stop the bounces and finally did. Here are some of the things you should try, and my ultimate solution.