...

View Full Version : Sending email and Sending notices to yourself



Trusten
07-16-2002, 04:25 AM
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?

Cloudski
07-16-2002, 04:48 AM
Hmm... probably just need to add another line to the send code...

First, the php code with a simple mail.....
sign.php


<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


<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

:thumbsup:

Cloudski
07-16-2002, 05:28 AM
*sigh* This i what sleep deprivation does to you.... you forget something in your code......

sign.php should actually look like:


<?
$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 ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum