getFile('example.txt'); $mail->setText($text); /** * Send the email using smtp method. The setSMTPParams() * method simply changes the HELO string to example.com * as localhost and port 25 are the defaults. */ $mail->setSMTPParams('localhost', 25, 'example.com'); $mail->setReturnPath('joe@example.com'); $mail->setBcc('bcc@example.com'); $mail->setCc('Carbon Copy '); $result = $mail->send(array('postmaster@localhost'), 'smtp'); // These errors are only set if you're using SMTP to send the message if (!$result) { print_r($mail->errors); } else { echo 'Mail sent!'; } ?>