While troubleshooting a contact form with an e-mail host they told me to use \'-f\' in the from address of the php mail function. What does the \"-f\" flag do and why would
The -f option is to set the bounce mail address. Sending a message without one can negatively influence the spam-score that is being calculated over the message. Messages with low scores sometimes get filtered out for certain hosts.
You can use https://www.mail-tester.com/ to test the score of your message. You can expirement with or without the -f flag and see the score change.