Sì, PHPMailer è una scelta molto buona.
Ad esempio, se si desidera, è possibile utilizzare il server SMTP googles gratuito (è come inviare dal proprio account Gmail.), Oppure è possibile saltare la parte smtp e inviarla come una tipica chiamata mail(), ma con tutte le intestazioni corrette ecc. Offre e-mail multipart, allegati.
Abbastanza facile da configurare.
<?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;
}
?>
fonte
2011-02-10 23:07:50
sto usando qualcosa del genere atm – dynamic
Quindi ... questo usa SMTP e SSL? –
@Sortofabeginner basta guardare il codice :) –