Tips and tricks on developing web sites

WordPress Mail

EDITING REQ’D If you want to send email through the WordPress engine, you will either need a plugin or setup a hook. I prefer to avoid plug-in’s and maintain as much control over my sites as possible, so I add a hook. It’s pretty easy. Locate your themes functions.php file \wp-content\themes\yourtheme and add this code (this came right from wordpress.org)

function my_phpmailer_example( $phpmailer ) {
    $phpmailer->isSMTP();     
    $phpmailer->Host = 'smtp.example.com';
    $phpmailer->SMTPAuth = true; 
    $phpmailer->Port = 25;
    $phpmailer->Username = 'yourusername';
    $phpmailer->Password = 'yourpassword';
 
    // Additional settingsā€¦
    //$phpmailer->SMTPSecure = 'tls'; // Choose 'ssl' for SMTPS on port 465, or 'tls' for SMTP+STARTTLS on port 25 or 587
    //$phpmailer->From = "you@yourdomail.com";
    //$phpmailer->FromName = "Your Name";
}
add_action( 'phpmailer_init', 'my_phpmailer_example' );