Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

mail program

tanithtanith Posts: 1Member


I want to know about the mail() funtion php. Where it will send mail. I tried but it is showing message sent.
I am a fresher of php . plz explain me. I f you have any sample code plz send it.

Thanks for U...

Comments

  • muthubalajimuthubalaji Posts: 3Member
    [b][red]This message was edited by muthubalaji at 2004-6-20 21:43:32[/red][/b][hr]
    <?php
    try this following code.

    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $emailaddress = $_POST['emailaddress'];
    $to = "muthubalaji_2002@yahoo.co.in";
    $subject = "This is a test message";
    $message = "Hi,
    Can you contact $firstname $lastname on the following address:

    $emailaddress

    Thanks!";
    $kk=@mail($to,$subject,$message);
    if($kk)
    echo "Mail has been sent";
    else
    echo "Mail hasn't sent";
    ?>



    : I want to know about the mail() funtion php. Where it will send mail. I tried but it is showing message sent.
    : I am a fresher of php . plz explain me. I f you have any sample code plz send it.
    :
    : Thanks for U...
    :
    :



  • EnvitroEnvitro Posts: 3Member
    Well, the mail() function is a wrapper for the UNIX/Linux sendmail program (which is called a mail transport), which is a lot easier than any other way.

    However, if you don't have sendmail, then the best way to do that is to write a SMTP script that will connect to an SMTP server and send the mail for you, using sockets.

    Hope that helps.


    : [b][red]This message was edited by muthubalaji at 2004-6-20 21:43:32[/red][/b][hr]
    : <?php
    : try this following code.
    :
    : $firstname = $_POST['firstname'];
    : $lastname = $_POST['lastname'];
    : $emailaddress = $_POST['emailaddress'];
    : $to = "muthubalaji_2002@yahoo.co.in";
    : $subject = "This is a test message";
    : $message = "Hi,
    Can you contact $firstname $lastname on the following address:

    $emailaddress

    Thanks!";
    : $kk=@mail($to,$subject,$message);
    : if($kk)
    : echo "Mail has been sent";
    : else
    : echo "Mail hasn't sent";
    : ?>
    :
    :
    :
    : : I want to know about the mail() funtion php. Where it will send mail. I tried but it is showing message sent.
    : : I am a fresher of php . plz explain me. I f you have any sample code plz send it.
    : :
    : : Thanks for U...
    : :
    : :
    :
    :
    :
    :

Sign In or Register to comment.