1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| <?php
error_reporting(E_STRICT);
date_default_timezone_set('Europe/Paris');
require_once "../invitationftp/mail/class.phpmailer.php";
require_once "../invitationftp/mail/class.smtp.php";
$mail = new PHPMailer();
$mail = new PHPMailer();
$mail->SetLanguage('fr');
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.auth.orange-business.com"; // SMTP server
$mail->SMTPDebug = false; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Host = "smtp.auth.orange-business.com:587"; // sets the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "***"; // SMTP account username
$mail->Password = "***"; // SMTP account password
$mail->SetFrom($_POST['desti'], $_POST['desti']);
$mail->AddReplyTo($_POST['desti'], $_POST['desti']);
$mail->Subject = "Joyeux noel";
$mail->AddEmbeddedImage('../invitationftp/mail/carte.jpg', 'carte', 'carte.jpg');
$body="cliquer sur la carte pour voir l'animation : <br>
<a href='http://***/carte.php?carte=$cle'><img src=\"cid:carte\" /></a>
";
$mail->MsgHTML($body);
$address = $_POST['exp'];
$mail->AddAddress($address, $address);
if(!$mail->Send()) {
echo "</div><p align='center'><strong style=\"color:#ff0000;\">Une erreur c'est produite lors de l'envoi.</strong></p>";
} else { echo "</div><h1>Votre carte a bien été envoyée</h1><br/><a href='creer.php'>Retour</a>"; }
}else
{echo '<p>E-mail n\'est pas valide.</p>';}}else
{echo '<p>E-mail n\'est pas valide.</p>';}
} else {
$nom=$_POST['nom'];
$exp=$_POST['exp'];
$desti=$_POST['desti'];
header("Location: creer.php?nom=$nom&exp=$exp&desti=$desti");
}}
?> |
Partager