DIGIT-ARC read-only archive · snapshot: July 23, 2026

PHP mail function

12 posts · originally from https://geek.digit.in/community/threads/php-mail-function.2342/

A
anilsmart Original post #1
Oct 28, 2004 at 12:46 AM
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
I
ishaan #2
Oct 28, 2004 at 10:57 AM
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 at 11:17 AM
Why dont u Google and search????
firewall
Oct 28, 2004 at 6:15 PM
check this out

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

:)
B
Oct 28, 2004 at 10:50 PM
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
Deep #6
Oct 28, 2004 at 11:40 PM
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
A
Oct 29, 2004 at 12:05 AM
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
Deep #8
Oct 29, 2004 at 12:11 AM
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
A
Oct 29, 2004 at 12:20 AM
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
Deep #10
Oct 29, 2004 at 12:24 AM
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
A
anilsmart #11
Oct 29, 2004 at 12:40 AM
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
Deep #12
Oct 29, 2004 at 7:12 AM
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