Sending E-mail Within PHP
SENDING MAIL
To Whom :
Topic :
Message :
Let's hope this message to be sent!
How many :
<?
$Target =$_POST["Target"];
$Topic =$_POST["Topic"];
$Message=$_POST["Message"];
$Num =$_POST["Num"];
$Send =$_POST["Send"];
for($i=1; $i<=$Num; $i++) { $Send=mail($Target, $Topic, $Message);
if ($Send) { echo "Your mail is sent."; } else { echo "Unexpected error!"; } }
?>
AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1
Sorry that I have forgot to write that my page is not on a web server. It is on my computer.
The PHP script is being run on "Apache 2.0 - PHP 5 - WinXP" platform.
AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1
So, how can I install a mail server to my computer. Isn't there a way for sending mail without setting the page onto an external (real) web server?
AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1
That is all OK.
But,For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.what is this "SENDMAIL BINARY"?
AhmedHan
Junior Poster in Training
71 posts since Apr 2005
Reputation Points: 13
Solved Threads: 1