Re: PHP Mail

There isn't any mailer-daemon listening on localhost also modifying the php.ini the mail will not go...
You need to use PEAR library and the PHPMailer class to send thru an external SMTP server with authentication.
There's also another way, using plain PHP, if your cable/ADSL provider gives you SMTP server without authentication change localhost with it's smtp server.
You need to use PEAR library and the PHPMailer class to send thru an external SMTP server with authentication.
- Code: Select all
require_once('/library/PHPMailer/class.phpmailer.php');
$mail = new \PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = 'login';
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = 'example@gmail.com';
$mail->Password = 'somepassword';
$mail->SetFrom('example@gmail.com', 'Example');
$mail->Subject = 'The subject';
$mail->Body = 'The content';
$mail->AddAddress('receiver@gmail.com');
$mail->Send();
There's also another way, using plain PHP, if your cable/ADSL provider gives you SMTP server without authentication change localhost with it's smtp server.