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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
<?php
session_name('calcul');
session_start();
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type='text/JavaScript'>
function getXhr(){
var xhr = null;
if(window.XMLHttpRequest) // Firefox et autres
xhr = new XMLHttpRequest();
else if(window.ActiveXObject){ // Internet Explorer
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
else { // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
xhr = false;
}
return xhr
}
function go(){
var xhr = getXhr()
xhr.open("GET","ajax.php",true);
xhr.send(null);
}
</script>
<title>Etape 6</title>
<link href="css/general.css" rel="stylesheet" type="text/css" />
</head>
<body onbeforeunload="go()"><div>
<h1>Etape 6</h1>
<form id="form6" method="post" action="page6.php">
<?php
if (!empty($_POST['mail']))
{
$MAIL = $_POST['mail'];
$eMail = $MAIL."@societe.com";
$pieceJointe = $_SESSION['file_name'];
include "../class.phpmailer.php";
$mail = new PHPmailer();
$mail->IsSMTP();
// $mail->IsHTML(true);
$mail->Host='smtp.societe.com';
$mail->From='bidule@societe.com';
$mail->AddAddress($eMail);
// $mail->AddReplyTo('machin@societe.com');
$mail->Subject='Calculs - '.$pieceJointe;
$mail->Body='Merci de ne pas répondre à ce mail automatique. Veuillez trouver votre fichier en pièce jointe.';
$mail->AddAttachment($pieceJointe);
if(!$mail->Send()){
echo $mail->ErrorInfo;
}
else{
echo 'Mail envoyé avec succès';
}
$mail->SmtpClose();
session_unset ('calcul');
session_destroy ('calcul');
}
?>
<p>
<label for="mail">Veuillez indiquer votre eMail :</label><br />
<input type="text" name="mail" id="mail" /><label for="mail"> @societe.com</label>
</p>
<p>
<input type="submit" class="bouton" name="env_mail" id="env_mail" value="Envoyez" accesskey="e" />
</p>
</form>
</div></body>
</html> |
Partager