Another possibility is to set mail and net_smtp through a pear.
pear install Mail pear install Net_Smtp
then you have the ability to send mail using SMTP authentication to another server:
require_once "Mail.php"; $body = "Mein Mail Body\n"; $subject = "Mail mit SMTP Authentifizierung"; $mail_to = " zumir@meinemailserver.de "; $mail_from = " phpmailer@meinemailserver.de "; //SMTP Verbindungsdaten $host = "smtp.meinemailserver.de"; $username = "phpmailer"; $password = "SuperGeheim"; $smtp = Mail::factory('smtp', array ( 'host' => $host, 'auth' => true, 'username' => $username, 'password' => $password )); $headers = array ( 'From' => $mail_from, 'To' => $mail_to, 'Subject' => $subject ); $mail = $smtp->send($mail_to, $headers, $body); if (PEAR::isError($mail)) { echo "Fehler beim Versender der E-Mail : ". $mail->getMessage(); }
(taken from http://www.jgeppert.com/2009/06/php-e-mail-mit-smtp-authentifizierung-versenden/ )
source share