Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('phpmailer/PHPMailerAutoload.php');
- $mail = new PHPMailer(true);
- $mail->IsSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup server
- $mail->Port = 465; // Set the SMTP port
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'email_di_invio@gmail.com'; // SMTP username
- $mail->Password = 'pssssw'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
- $mail->From = 'email_di_invio@gmail.com';
- $mail->FromName = 'Email di Invio';
- // Add a recipient
- $mail->AddAddress($_POST["email"]); // Indirizzo cliente
- $mail->IsHTML(false);
- $mail->CharSet = "text/html; charset=UTF-8";
- $mail->Subject = 'Riepilogo ordine';
- $mail->Body = $_POST["testo"];
- if(!$mail->Send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Message has been sent';
- -------INVIO LA SECONDA EMAIL--------
- $mail2 = new PHPMailer(true);
- $mail2->IsSMTP(); // Set mailer to use SMTP
- $mail2->Host = 'smtp.gmail.com'; // Specify main and backup server
- $mail2->Port = 465; // Set the SMTP port
- $mail2->SMTPAuth = true; // Enable SMTP authentication
- $mail2->Username = 'email_di_invio@gmail.com'; // SMTP username
- $mail2->Password = 'passsw'; // SMTP password
- $mail2->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
- $mail2->From = 'email_di_invio@gmail.com';
- $mail2->FromName = 'Email di invio';
- // Add a recipient
- $mail2->AddAddress('email_mia@gmail.com');
- $mail2->IsHTML(false);
- $mail2->CharSet = "text/html; charset=UTF-8";
- $mail2->Subject = 'Il tuo ordine';
- $mail2->Body = $_POST["testo"];
- if(!$mail2->Send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Message has been sent';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement