User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 428,633 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,946 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1330 | Replies: 3
Reply
Join Date: Dec 2007
Posts: 3
Reputation: amylawson is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
amylawson amylawson is offline Offline
Newbie Poster

php mail function with windows

  #1  
Dec 9th, 2007
Hi,

i am very new to php so please forgive me if i sound stupid.i have a tell friend php code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>iTell from urQuiz</title>
<style type="text/css">
<!--
.style2 {font-size: 12px}
-->
</style>
</head>
<body>
<form action="<? echo $_POST['self']; ?>" method="post"> Your Name : <br />
<input name="name" type="text"><br />Friend's Email Address : <br />
<input name="email" type="text"><br />
<input name="Send" type="submit" value="Send">
</form>
<?

if (@$_POST['Send']=="Send")
{
$name=$_POST['name'];
$email=$_POST['email'];
$subject = $name. " wants you to visit this site, its cool!";
//This is the body section of the email and can be substituted for your message
$message= "Hi, \n\n" .$name. " thinks you might like to visit our website : \n\n http://www.yourdomain.co.uk \n\n\n\n\n\n\n\nNote: This message was not sent unsolicited. It was sent through a form located at http://www.yourdomain.co.uk If you believe this message was received on error, please disregard it.";
$headers = 'From: webmaster@yourdomain.co.uk' . "\r\n" . 'Reply-To: webmaster@yourdomain.co.uk' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($email, $subject, $message, $headers);
echo "You`ve recommended our site to: $email Thanks you";
}
?>
<br />
<br />


</body>

</html>


i am running this code on windows >apache server and php 5.
but i cant seem to get it to work.could anybody please help me out and suggest how i could get this script to work on windows ..do i need to change anything in the code or do i need to download any other software..please help
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: php mail function with windows

  #2  
Dec 9th, 2007
Again, what is the error you are getting ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Dec 2007
Posts: 3
Reputation: amylawson is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
amylawson amylawson is offline Offline
Newbie Poster

Re: php mail function with windows

  #3  
Dec 10th, 2007
hi,
the code seems to work as i dont get any errors but i do not get any emails after running the code
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: php mail function with windows

  #4  
Dec 10th, 2007
Umm..sometimes mails sent by php is considered as spam(because of the unknown domain). If that isn't the problem, check your smtp and smtp_port in php.ini.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 12:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC