-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrichiesta-preventivo-sendmail.php
65 lines (61 loc) · 2.64 KB
/
richiesta-preventivo-sendmail.php
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
<html>
<?php
if(isset($_POST['dati']))
{
$array_dati = $_POST['dati'];
echo "<b>Sono stati inseriti i seguenti dati: </b>" . $array_dati . "<br/>";
$elemementi = explode(";", $array_dati);
$to = '[email protected]';
//formato html
$subject = 'Richiesta preventivo';
$message = '
<html>
<head>
<title>Richiesta preventivo</title>
</head>
<body>
<p align="center"><font size="4" color="#48CA0D"><b>Richiesta preventivo per il seguente prodotto:</b></font></p>
<p> </p>
<p align="center><font size="18"><b>ID </b><font color="#0DE0E1">' . $elemementi[0] . '</font>;' .
'<b> CODICE </b><font color="#0DE0E1">' . $elemementi[1] . '</font>;' .
'<b> DESCRIZIONE </b><font color="#0DE0E1">' . $elemementi[2] . '</font></font></p>
<table border="1">
<tr>
<th style="color:#EC1B23">Quantita</th>
<th style="color:#EC1B23">Colore</th>
<th style="color:#EC1B23">Colori stampa-fronte</th>
<th style="color:#EC1B23">Colori stampa-retro</th>
<th style="color:#EC1B23">Colori manica destra</th>
<th style="color:#EC1B23">Colori manica sinistra</th>
<th style="color:#EC1B23">Telefono</th>
<th style="color:#EC1B23">Note</th>
</tr>
<tr>
<td>' . $elemementi[3] . '</td><td>' . $elemementi[4] . '</td><td>' . $elemementi[5] . '</td><td>' . $elemementi[6] . '</td><td>' .
$elemementi[7] . '</td><td>' . $elemementi[8] . '</td><td>' . $elemementi[12] . '</td><td>' . $elemementi[13] . '</td>
</tr>
</table>
<p> </p>
<p align="left"><font size="2">Cordiali saluti<br>' . $elemementi[9] . ' ' . $elemementi[10] . ', ' . $elemementi[11] . '<br> Tel. ' . $elemementi[12] . '</font></p>
</body>
</html>
';
// set del Content-type
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// altri headers
$headers .= 'To: Aissa Technologies Market <[email protected]>' . "\r\n";
$headers .= 'From: ' . $elemementi[9] . ' ' . $elemementi[10] . ' <' . $elemementi[11] . '> ' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$headers .= 'Bcc: [email protected]' . "\r\n";
$headers .= 'Reply-To:' . $elemementi[9] . ' ' . $elemementi[10] . ' <' . $elemementi[11] . '> ' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
/*bool $esito = mail($to, $subject, $message, $headers);
echo $esito;
if(!esito) {
return echo 'Errore nella trasmissione del messaggio!';
}
echo 'Il messaggio è stato trasmesso con successo';*/
}
?>