Jump to content


Photo

Sending Email with php


  • Please log in to reply
5 replies to this topic

#1 SueHubert

SueHubert
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 08 April 2006 - 10:08 AM

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

#2 TheUkSniper

TheUkSniper
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 08 April 2006 - 10:14 AM

are you running the mail server off your own computer?? if so then your mail has probally been put in ur junk email folder

#3 SueHubert

SueHubert
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 08 April 2006 - 10:43 AM

Nope i have checked but nothing...:-(...


#4 MikeFairbrother

MikeFairbrother
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 08 April 2006 - 10:47 AM

Is it set to be from a specific place, like from system@system.com..

Post your coding?

Maybe Norton is also blocking it as recognised/potential SPAM?

#5 TheUkSniper

TheUkSniper
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 08 April 2006 - 10:47 AM

is there a log for whatever program ur using to send the email so u can see if it has been sent out?

#6 SueHubert

SueHubert
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 08 April 2006 - 03:40 PM

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>';
}

}
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users