954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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
 

contact your webhost as it seems they have not properly set up the mail servers in the config files, or maybe you just weren't given permission

paradox814
Posting Whiz
351 posts since Oct 2004
Reputation Points: 13
Solved Threads: 4
 

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 will that process den ? since u didn't put up ur pages in ur web server ?

developerszone
Newbie Poster
4 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

you will have to setup a mail server, and point it there

paradox814
Posting Whiz
351 posts since Oct 2004
Reputation Points: 13
Solved Threads: 4
 

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
 

i did a quick google search for mail servers.... why don't you give it a try:
http://www.google.com/search?hl=en&q=mail+server&btnG=Google+Search

paradox814
Posting Whiz
351 posts since Oct 2004
Reputation Points: 13
Solved Threads: 4
 

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
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You