Ho scaricato questo script per inviare delle mail tramite form.. ho configurato il campo receiverMail = "your@mail.com" con l'indirzzo corretto...mi compare che il messaggio è stato spedito..e invece non ricevo nulla nella casella...(ho uno spazio su altervista)
da cosa può dipendere?
Codice PHP:
?php
/**************************/
/* EMAIL CONTACT FORM */
/* VERSION 1.1 */
/* by Epleweb */
/**************************/
if ($_POST['submit'] == TRUE) {
$receiverMail = "your@mail.com";
$name = stripslashes(strip_tags($_POST['name']));
$email = stripslashes(strip_tags($_POST['email']));
$subject = stripslashes(strip_tags($_POST['subject']));
$msg = stripslashes(strip_tags($_POST['msg']));
$ip = $_SERVER['REMOTE_ADDR'];
$msgformat = "From: $name ($ip)\nEmail: $email\n\n$msg";
if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
echo "<h2>The email was not sent</h2>
Please fill all the required fields</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
echo "<h2>The email was not sent</h2>
The email address is invalid</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
echo "<h2>The email has been sent!</h2>
I will get back to you as soon as possible.</p>"; }
else {
echo "<h2>The email was not sent</h2>
Please try again... If the problem continues there's probably something wrong with the server.</p>";
}
}
else { ?>
<form method="post" action="">
<input id="name" name="name" type="text" size="30" maxlength="40" /><label for="name">Nome</label>
<input id="email" name="email" type="text" size="30" maxlength="40" /><label for="email">E-mail</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" /><label for="subject">Soggetto</label>
<textarea id="message" name="msg" cols="50" rows="6"></textarea><label for="message">Messagio</label>
<label for="submit"></label>
<input id="submit" class="button" type="submit" name="submit" value="Invia" />
</p>
</form>
<?php }