Ciao a tutti!
Sto creando uno script che deve girare in locale, ho quasi finito il lavoro ma mi manca l'invio dell'email.
Premetto che sto lavorando in locale (xampp) e che il cliente lo utilizzerà allo stesso modo.
Io ho un form e, dopo aver inserito i dati, questi devono essere inviati via email (e registrati nel db, ma questo lo fa già :-) ). Purtroppo però non funziona (sto provando phpmailer), questo è il codice:
codice:
<?PHP
require(“phpmailer/class.phpmailer.php”);
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
IsSMTP(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = ”miousername@gmail.com“; // Enter your SMTP username
$mail->Password = ”miapassword“; // SMTP password
$webmaster_email = ”webmasterusername@gmail.com“; //Add reply-to email address
$email=”destinatariousername@libero.it“; // Add recipients email address
$name=”name“; // Add Your Recipient’s name
$mail->From = $webmaster_email;
$mail->FromName = ”Webmaster”;
$mail->AddAddress($email,$name);
$mail->AddReplyTo($webmaster_email,”Webmaster”);
$mail->WordWrap = 50; // set word wrap
//$mail->AddAttachment(“/var/tmp/file.tar.gz”); // attachment
//$mail->AddAttachment(“/tmp/image.jpg”, “new.jpg”); // attachment
$mail->IsHTML(true); // send as HTML
$mail->Subject = ”This is your subject“;
$mail->Body = ”Hi, this is your email body, etc, etc” ; //HTML Body
$mail->AltBody = ”Hi, this is your email body, etc, etc“; //Plain Text Body
if(!$mail->Send()){
echo “Mailer Error: ” . $mail->ErrorInfo;
} else {
echo “Message has been sent”;
}
?>
Ovviamente accetto anche soluzioni alternative. Vi ringrazio anticipatamente e vi auguro una buona giornata :-)