Tak, PHPMailer jest bardzo dobrym wyborem.
Na przykład, jeśli chcesz, możesz użyć darmowego serwera SMTP na google (to tak, jak wysyłasz z konta Gmail). Możesz też pominąć część smtp i wysłać ją jako typowe wywołanie mail(), ale ze wszystkimi prawidłowymi nagłówkami itp. Oferuje wieloczęściowe wiadomości e-mail, załączniki.
Bardzo łatwy w konfiguracji.
<?php
$mail = new PHPMailer(true);
//Send mail using gmail
if($send_using_gmail){
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "your-gmail-password"; // GMAIL password
}
//Typical mail data
$mail->AddAddress($email, $name);
$mail->SetFrom($email_from, $name_from);
$mail->Subject = "My Subject";
$mail->Body = "Mail contents";
try{
$mail->Send();
echo "Success!";
} catch(Exception $e){
//Something went bad
echo "Fail - " . $mail->ErrorInfo;
}
?>
Używam czegoś takiego, jak ten bankomat – dynamic
Więc ... to używa SMTP i SSL? –
@Sortofabeginner wystarczy spojrzeć na kod :) –