Click to See Complete Forum and Search --> : mail


mastaoneil
08-13-2004, 04:00 AM
<?
mail('mastaoneil@hotmail.com',"webspace","sffdsfdsafdas");
?>

this doesnt seem to work ive tried it on my own apache server and i tried it on free host what could be the problem

cheers

nebulous
08-13-2004, 04:11 AM
maybe your php.ini settings are not configured correctly to send a mail or PHP does not have access to the sendmail binary on your system?!

Try: http://de3.php.net/manual/en/ref.mail.php for more details on how to configure your system.

mastaoneil
08-13-2004, 04:31 AM
the php.ini settings are left as the recommended settings do i need to change anything and what is the sendmail binary?

squallflight
08-13-2004, 05:54 AM
I believe the sendmail binary is a scipt that PHP and apache need to be pointed to if an SMTP server is not present. In otherworks if you can't send it the normal way (SMTP) then u have to use that.

I know that the server I use has a send mail binary which is somethin like /usr/bin/sendmail

Oh and if you have installed PHP on your own server you will have to amend the php.ini file with WINDOWS you have to provide an SMTP server with UNIX you must provide a sendmail path

oh, the mail function requires all strings in the double quotes "" I tried with single quotes and it doesn't like it, it'll send the email but your email server will come up with a processing error such as "cannot process headers"

physicfor
08-13-2004, 02:05 PM
SALAMO ALYKOM

IF YOU ARE USINING A WINDOWS SERVER USE THE FOLLOWING CODE TO SEND



===============================================================
<?php

ini_set (SMTP,"your server.com");//please type your server here inseted
ini_set (smtp_port,"25");
?>


<br>&nbsp;<form method="POST" action="mail.php">
<input type =hidden value =mailer name =theform >

<div align="right">
<table border="1" width="100%" dir="rtl">
<tr>
<td width="133">sender:</td>
<td><input type="text" name="from" size="51"></td>
</tr>
<tr>
<td width="133">to:</td>
<td><input type="text" name="to" value="helmelyom@yahoo.com" size="51">
you cna change the mail address as you like
</td>
</tr>
<tr>
<td width="133" height="29">subject :</td>
<td height="29"><input type="text" name="subject" size="51"></td>
</tr>
<tr>
<td width="133">message</td>
<td>
<p align="center">
<textarea rows="8" name="emailbody" cols="53" style="color: #0000FF">your message here </textarea></td>
</tr>
</table>
</div>
<p dir="rtl"><input type="submit" value="submit" name="B19">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="reset" name="B20"></p>
</form>
<p>


<!--------------------------------------send mail -----><?
if ($theform==mailer)
{

ini_set(sendmail_from, $from);

mail("$to", $subject, $emailbody,
"From: $from \n\r
Reply-to: $from \n\r");

ini_restore(sendmail_from);


echo"the mail has been send";
}

?>
=========================================================

IF YOU ARE USING UNIX SERVER JUST USE THE FOLLOWING



<br>&nbsp;<form method="POST" action="mail.php">
<input type =hidden value =mailer name =theform >

<div align="right">
<table border="1" width="100%" dir="rtl">
<tr>
<td width="133">sender:</td>
<td><input type="text" name="from" size="51"></td>
</tr>
<tr>
<td width="133">to:</td>
<td><input type="text" name="to" value="helmelyom@yahoo.com" size="51">
you cna change the mail address as you like
</td>
</tr>
<tr>
<td width="133" height="29">subject :</td>
<td height="29"><input type="text" name="subject" size="51"></td>
</tr>
<tr>
<td width="133">message</td>
<td>
<p align="center">
<textarea rows="8" name="emailbody" cols="53" style="color: #0000FF">your message here </textarea></td>
</tr>
</table>
</div>
<p dir="rtl"><input type="submit" value="submit" name="B19">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="reset" name="B20"></p>
</form>
<p>


<!--------------------------------------send mail -----><?
if ($theform==mailer)
{

ini_set(sendmail_from, $from);

mail("$to", $subject, $emailbody,
"From: $from \n\r
Reply-to: $from \n\r");

ini_restore(sendmail_from);


echo"the mail has been send";
}

?>

YOU CAN TRY THIS CODE ON THE FOLLOWING ADDRESS
http://www.jazeerat-aloud.com/php-jaz/mail.php

YOURS MOHAMED ALI