lemix07
25-11-2009, 09:09
vorrei inviare dal mio sito delle email con delle immagini , che aprendo le email dal client le immagini si vedano ho creato questo form copiando il codice html...... se qualcuno m puo' dire dove sbaglio?
questo è il codice
<?php
// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "destinataro";
// IL SOGGETTO DELLA MAIL
$subject = "Modulo proveniente dal sito www.sito.it";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "Contenuto del modulo:\n\n";
$body .= "Dati personali nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Città: " . trim(stripslashes($_POST["citta"])) . "\n";
$body .= "Oggetto: " . trim(stripslashes($_POST["oggetto"])) . "\n";
$body .= "testo: " . trim(stripslashes($_POST["testo"])) . "\n";
$body .= "mail: " . trim(stripslashes($_POST["mail"])) . "\n";
// INTESTAZIONI SUPPLEMENTARI
$headers = "From: Modulo utenti<INDIRIZZO-COME-SOPRA>";
?>
<html>
<head>
<title>La mia email HTML</title>
<style type="text/css">
body {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:normal; color:#000000;}
</style>
</head>
<body>
<p>Ecco la mia prima mail in HTML.<br>
Questo testo è in <strong>bold</strong></p>
<p>E qui ci metto una immagine: <img src="miosito.jpeg"></p>
</body>
</html>
<?php
// INVIO DELLA MAIL
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail è stata inoltrata con successo.";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail.";
}
?>
questo è il codice
<?php
// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "destinataro";
// IL SOGGETTO DELLA MAIL
$subject = "Modulo proveniente dal sito www.sito.it";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "Contenuto del modulo:\n\n";
$body .= "Dati personali nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "cognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Città: " . trim(stripslashes($_POST["citta"])) . "\n";
$body .= "Oggetto: " . trim(stripslashes($_POST["oggetto"])) . "\n";
$body .= "testo: " . trim(stripslashes($_POST["testo"])) . "\n";
$body .= "mail: " . trim(stripslashes($_POST["mail"])) . "\n";
// INTESTAZIONI SUPPLEMENTARI
$headers = "From: Modulo utenti<INDIRIZZO-COME-SOPRA>";
?>
<html>
<head>
<title>La mia email HTML</title>
<style type="text/css">
body {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:normal; color:#000000;}
</style>
</head>
<body>
<p>Ecco la mia prima mail in HTML.<br>
Questo testo è in <strong>bold</strong></p>
<p>E qui ci metto una immagine: <img src="miosito.jpeg"></p>
</body>
</html>
<?php
// INVIO DELLA MAIL
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "La mail è stata inoltrata con successo.";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail.";
}
?>