Jump to content

Sending Email with php


SueHubert

Recommended Posts

Ello all,

I am hoping that someone will be able to help because i am officially stumped. I am trying to create a contact form for my website. I have created the form and the php script as the backend..they both work...well kinda. I get confirmation that the email was sent...norton antivirus even scans the message...but when i check my inbox there is no email....help! so confused!

Cheers :-)
Su
Link to comment
Share on other sites

Thanks for the replies - its not norton antivirus because i have tried it with it switched off. here is my php script:


<?

if (isset($_POST['submitted'])) {

$errors = array();

if (empty($_POST['name'])){
$errors[] = 'Enter Name.';
}

if (empty($_POST['email'])){
$errors[] = 'Enter Email.';
}

if (empty($_POST['comments'])){
$errors[] = 'Comments.';
}
if(empty($errors)) {

$body = "Thanks for your comments";
mail ($_POST['email'], 'Thanks',$body, 'From: admin@locahost');


echo '<h1 id="mainhead">Thanks</h1>
<p>All done.</p><p><br /></p>';

} else {

echo '<h1 id="mainhead">Error!</h1>
<p class="error">The following errors occured:<br />';
foreach ($errors as $msg) {
echo " - $msg<br />\n";
}
echo '</p><p>Try again.</p><p><br /></p>';
}

}
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.