PHP mail function

Status
Not open for further replies.

anilsmart

Broken In
somebody please tell me how to use the php mail function. i think its sytax is
mail(Senerder's address, subject , body)
but the above one is not sending the mail so should i have to configure myoutgoing mail server before using this function or the above sytanx has to be change
 

ishaan

Padawan
i dont know anything about php coding....but i do know that many sites dont support the mail function of php unless u pay them....if ur on a free site that may be so
 

Butterfly

Broken In
Well try , why not try PM experts

Ok best way to pin point ur bug is PM experts in this foroum , say like Yahoo mSg or MSN msg...u hit the jack pot duide
 

Deep

Version 2.0
mail ($mail_to,$mail_subject,$mail_message,$mail_from);

or if you want to write direct address then

mail ("deep@deep.com","Hi this is subject","this is body","deep@from.com");

you can also pass headers through mail function i.e. to send html mails or attach stuff into mail..

tell me the exact requirements so that i can help you out..

Deep
 
OP
A

anilsmart

Broken In
WELL DEEP THANX FOR YOUR GREAT HELP BUT I M STILL UNABLE TO SEND MAILS USING PHP MAIL(). HERE THE TEST CODE I USE TO SEND MAIL CHECK THIS AND TELL ME WHERE IS THE FAULT:
<?php
if(mail("anilmail17@yahoo.co.in","hiiiii","check this"))
echo "mail sended";
else
echo "mail delivery failure";
?>

I HAD VISITED YOUR SITE WWW.WHOISDEEP.COM AND LIKE IT VERY MUCH.
 

Deep

Version 2.0
anilsmart said:
WELL DEEP THANX FOR YOUR GREAT HELP BUT I M STILL UNABLE TO SEND MAILS USING PHP MAIL(). HERE THE TEST CODE I USE TO SEND MAIL CHECK THIS AND TELL ME WHERE IS THE FAULT:
<?php
if(mail("anilmail17@yahoo.co.in","hiiiii","check this"))
echo "mail sended";
else
echo "mail delivery failure";
?>

I HAD VISITED YOUR SITE WWW.WHOISDEEP.COM AND LIKE IT VERY MUCH.

thanks anil for the compliment :)

code seems to be working fine but something wrong with the condition..

what exactly u wanna do ?

coz your if condition seems to be incorrect... (code is proper but logic doesnt seem to be right)

Deep
 
OP
A

anilsmart

Broken In
THIS IS TEST CODE I M USING TO CHECK HOW TO USE THE MAIL FUNTCION MY SERVER IS FREELINUX.COM AND HERE ARE IT DETAILS

SMTP (outgoing mail server) : mail.freelinuxhost.com
SMTP port : 25
Operating system : Debian GNU/Linux
 

Deep

Version 2.0
hmm i think it shall work without giving codition also

if mail isnot been sent due to code error then it shall throw the error on the page..

what error is it showing u ?

Deep
 
OP
A

anilsmart

Broken In
NO I M NOT GETTING ANY TYPE OF ERROR CODE THE CODE WORKS FINE I GET THE OUTPUT 'MAIL SENDED' BUT NO NEW MAIL IS RECIVED TO ME
YOU CAN CHECK THIS *efriend.freelinuxhost.com/mail.php
 

Deep

Version 2.0
then it should go logically...

try adding from address in the end coz sometimes web host can disable from "nobody" by default...

add from address in the end and see..

Deep
 
Status
Not open for further replies.
Top Bottom