i want to send an automatic mail .how to tht in a php script.i can use mail() fuction but it is not working.what type configuration i should do.please tell
sending mail in php
Collapse
X
-
[php]$to = "bilkirim@yahoo .gr";
$subject = "Hello Bill";
$body = "type your text here";
if (mail($to, $subject, $body))
{
echo("<p>Messag e successfully sent!</p>");
}
else
{
echo("<p>Messag e delivery failed...</p>");
}
[/php]
You have to make some changes to your php.ini file..
[mail function]
; For Win32 only.
SMTP = your_mail_domai n
smtp_port = 25
; For Win32 only.
sendmail_from = bilkirim@themus icase.com //yout mail
i have my own mail domain.. i don't think that it works with yahoo,hotmail mails but i am not sure. -
Originally posted by gladyI am having the same problem, but i am using unix sendmail program and the mail server is exim 3.36.
Could you help with php mail() program?
Thanks
the only differense is in the php.ini file.
you have to add this line
sendmail_path = (your sendmail path)Comment
-
Originally posted by billkirimsorry i forgot.. You have to restart your server to apply the changes..
If it is apache.
c:\(apache path)\apache -k restart
do i need to go to shell prompt and give the path of php.ini file and restart?
like.....
myusername@sand box:~\etc\php4\ apache\php.ini -k restart
ThanksComment
-
Originally posted by gladyDo i need to give in command line,
do i need to go to shell prompt and give the path of php.ini file and restart?
like.....
myusername@sand box:~\etc\php4\ apache\php.ini -k restart
Thanks
It is Stored to Your System Direcory.
The only thing you have to do is.
to go to your apache folder (where you biuld apache)
if you don't know search for the Apache.exe file
it mostly be in a \bin\ directory
and then
myusername@sand box:~\etc\www\a pache\bin\apach e -k restartComment
-
Originally posted by billkirimNo Apache look automatic for Your Php.ini File..
It is Stored to Your System Direcory.
The only thing you have to do is.
to go to your apache folder (where you biuld apache)
if you don't know search for the Apache.exe file
it mostly be in a \bin\ directory
and then
myusername@sand box:~\etc\www\a pache\bin\apach e -k restart
Will the problem be in the
sendmail_path=
do i need to give explicitly the path or will it take the default value?
the default value is "sendmail -t -i"
Is it possible to open and read sendmail program?Comment
Comment