Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    Earth
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending email and Sending notices to yourself

    when someone registers, it sends an email to them, is there anyway to have an email sent back to you, making you aware that someone has registered?
    Life is funny, especially when you're poor.

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm... probably just need to add another line to the send code...

    First, the php code with a simple mail.....
    sign.php
    PHP Code:
    <HTML>
    <HEAD>
    <TITLE>
    Thank ou for signing!
    </TITLE>
    <BODY>
    <?
    mail
    ("$admin","$subject","User Name: $usrname \n Password: $usrpass \n Other: $other""From: $from ");
    if(
    $mail_test !=1) {
    echo(
    "There was an error in sending the message. Please double check you entered a valid e-mail.");
    }
    else {
    echo(
    "Thank you for signing up.");
    }
    ?>
    </BODY>
    </HTML>
    Here is the form that could be used with it:
    signin.html
    Code:
    <HTML>
    <HEAD><TITLE>SIGN-UP!!!</TITLE></HEAD>
    <BODY>
    <form action="sign.php" method="post">
    <input type="hidden" value="Your_Email_Here" name="admin">
    <input type="hidden" value="Someone Joined! YAY!" name="subject">
    <input type="text" name="usrname" value="Enter User Name"> -(So I know it is YOU uploading.)<br><br>
    <input type="text" name="usrpass" value="Enter a password."> -(Your log-in password.)<br><br>
    <input type="text" name="from" value="Enter your e-mail."> -(For Contact info. and validation.) <br><br>
    <textarea wrap=virtual rows=5 cols=35 name="other">Enter any other informaiton here.</textarea><br><br>
    <input type="submit" value="submit">
    </form>
    </BODY>
    </HTML>
    (Anything in bold is something you need to change/or might want to. For the username and password fields, I have value there for test to be previously in there before they input something... you can remove those if you want.)

    Now, if you can find where in your code they are sending the person who signed in the e-mail, you just need to add a second mail finction.

    Here is a little tutorial on it in case I confused you.
    What goes inot the mail function is this:
    mail("the_recipients_email","the_subject","the message body","From: the_e-mail_you_want_it_to_be_from");

    In my the body, I had /n, which basically ends that line and starts another. Kinda like hitting the enter button, but tha doesn't work in code.

    Thats about all I can really tell you since I am 1) A newbie as well, and 2) I don't have any source code to run on.

    I hope I helped at least some


  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    U.S. (Wish Japan though)
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *sigh* This i what sleep deprivation does to you.... you forget something in your code......

    sign.php should actually look like:
    PHP Code:
    <?
    $mail_test
    ="";
    $mail_test mail("$admin","$subject","User Name: $usrname \n Password: $usrpass \n Other: $other""From: $from ");
    if(
    $mail_test !=1) {
    echo(
    "There was an error in sending the message. Please double check you entered a valid e-mail.");
    }
    else {
    echo(
    "Thank you for signing up.");
    }
    ?>
    Sorry for hte mistake


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •