# PHP mail function



## anilsmart (Oct 28, 2004)

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 (Oct 28, 2004)

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


----------



## xenkatesh (Oct 28, 2004)

Why dont u Google and search????


----------



## firewall (Oct 28, 2004)

check this out 

*www.phpfreaks.com/phpmanual/page/function.mail.html


----------



## Butterfly (Oct 28, 2004)

*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 (Oct 28, 2004)

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


----------



## anilsmart (Oct 29, 2004)

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 (Oct 29, 2004)

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";
> ...



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


----------



## anilsmart (Oct 29, 2004)

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 (Oct 29, 2004)

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


----------



## anilsmart (Oct 29, 2004)

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 (Oct 29, 2004)

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


----------

