mail("<paramaters>"); Function Help!

Discussion in 'PHP' started by richbate, May 28, 2007.

  1. #1
    Hi there, I'm stuck on what is proberly a simple mistake on my site.

    The situation is this:

    user registers -> Random Key is generated -> Key Mail'd to user

    The problem is, when the email is set, its ususal just forwarded to peoplest. spam... what i dont want..

    mail("$email", "from: ", "Welcome to QuestLife! You are now one step away from joining us.\n\n Please click on the following link to validate your account!\n\n http://www.rich-bate.co.uk/questlife/activate.php?username=$username&password=$password&keynode=$thekey \n\n");


    That is the code i am using at the moment, i dont know what im doing wrong but if someone could point me in the right way.. or show me a paramater guide.. i'd be greatful..

    Rich
     
    richbate, May 28, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #3
    here's how i would do it.

    
    <?php
        $recipient = $email; // their email
        $subject = "welcome to gecku.co.uk"; // email subject
        $headers = 'From:  gecku.co.uk <admin@gecku.co.uk>' . "\r\n" .'X-Mailer: PHP/' . phpversion();
        $message = "Welcome to QuestLife! You are now one step away from joining us.\n\n Please click on the following link to validate your account!\n\n http://www.rich-bate.co.uk/questlife/activate.php?username=".$username."&password=".$password."&keynode=".$thekey ."\n\n";
    
        mail($recipient, $subject, $message, $headers);
    ?>
    
    Code (markup):
    hope this helps.

    Regards,
    ansi
     
    ansi, May 28, 2007 IP