mail program - Programmers Heaven

Howdy, Stranger!

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

Categories

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 = "[email protected]";
    $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 = "[email protected]";
    : $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.