PHP mail function

Discussion in 'Internet & WWW' started by anilsmart, Oct 28, 2004.

Thread Status:
Not open for further replies.
  1. anilsmart

    anilsmart New Member

    Joined:
    Oct 10, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. ishaan

    ishaan New Member

    Joined:
    Feb 28, 2004
    Messages:
    894
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New Delhi
    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
     
  3. xenkatesh

    xenkatesh Bewitched!

    Joined:
    Feb 7, 2004
    Messages:
    468
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    chennai
    Why dont u Google and search????
     
  4. firewall

    firewall New Member

    Joined:
    Mar 31, 2004
    Messages:
    299
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Kolkata - INDIA
  5. Butterfly

    Butterfly New Member

    Joined:
    Sep 20, 2004
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Thimphu
    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
     
  6. Deep

    Deep Version 2.0

    Joined:
    Jan 23, 2004
    Messages:
    977
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
    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
     
  7. OP
    OP
    anilsmart

    anilsmart New Member

    Joined:
    Oct 10, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  8. Deep

    Deep Version 2.0

    Joined:
    Jan 23, 2004
    Messages:
    977
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
    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
     
  9. OP
    OP
    anilsmart

    anilsmart New Member

    Joined:
    Oct 10, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  10. Deep

    Deep Version 2.0

    Joined:
    Jan 23, 2004
    Messages:
    977
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
    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
     
  11. OP
    OP
    anilsmart

    anilsmart New Member

    Joined:
    Oct 10, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
  12. Deep

    Deep Version 2.0

    Joined:
    Jan 23, 2004
    Messages:
    977
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
    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
     
Thread Status:
Not open for further replies.

Share This Page