How to do auto generate email?

Discussion in 'PHP' started by jacey, Apr 10, 2006.

  1. #1
    Like this member registration system, the email will auto send to the ppl who registered as member. How can I do it in PHP? Btw, I dont have my own email server. Is it necessary?
     
    jacey, Apr 10, 2006 IP
  2. seolion

    seolion Active Member

    Messages:
    1,495
    Likes Received:
    97
    Best Answers:
    0
    Trophy Points:
    90
    #2
    You can use the mail function of PHP. The syntax is
    mail($address,$subject,$message,$headers);

    Here you can specify the headers as follows,

    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: you@you.com\r\n";

    $address="To Address";
    $subject="Mail Subject";
    $message="Your Message goes here";

    Try this out.. If your server configuration doesn't trouble you, mail will be sent without any prob..
     
    seolion, Apr 10, 2006 IP