How to send email from local to yahoo, gmail, etc? Testing PHPMailer and SwiftMailer

I’m trying to test an email feature that will use the localhost (currently testing the development localhost) to send emails to staff. But if the staff name uses an address such as name@yahoo.com, the email won’t ever arrive. I’d like to use what I’m understanding from what I’m reading about “email delegation” to get the job done – if it applies. I’m under the impression that there’s a way to use an “on behalf of”-type header designation to bypass the mail servers’ filters. This may not be the case, however.

I know I’m setting up both libraries correctly because both are able to send emails successfully for addresses such as name@mac.com, for example. For the yahoo-type addresses, neither PHPMailer nor SwiftMailer are going through. I’d like to stick with SwiftMailer because it appears more thorough and has more documentation.

Any thoughts would be appreciated.

Always seems to come back to this: Make sure your php.ini settings are correct.

Yank’s a champ. This article was written in 2002 and still answers the question: http://www.sitepoint.com/advanced-email-php/