When a new user signs up and creates a new record, filling out his email address in one field, is it possible to send him, automatically a "welcome" message to check his email address ? Thanks.
Jan 30, 1999, 9:03 PM
User (102 posts)
Jan 30, 1999, 9:03 PM
Post #2 of 6
Views: 3972
Yes there is, under the sub signup section you can place the following code.
# Add the userid into the file with default permissions.
if ($db_use_flock) {
flock(PASS, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
my $encrypted = crypt($in{'pw'}, $salt);
my $permissions = join (":", @auth_signup_permissions);
print PASS "$in{'userid'}:$encrypted:$permissions\n";
close PASS;
&html_signup_success;
open(LAST, ">>$latest") | | die $!;
print LAST "Userid: $in{'userid'}\n";
print LAST "Pass: $in{'pw'}\n";
print LAST "Email: $in{'Mail'}\n\n";
close(LAST);
use NET::SMTP;
$smtp = Net::SMTP->new('your.SMTPSERVER.net'); # connect to an SMTP server
$smtp->mail( 'yourname\@yourdomain.net' ); # use the sender's address here
$smtp->to($in{'Mail'}); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: $in{'Mail'}\n");
$smtp->datasend("From: yourname\@yourdomain.net\n");
$smtp->datasend("BCC: yourname\@yourdomain.net\n");
$smtp->datasend("Subject: Your Access Information\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Thank You for registering with us.\n");
$smtp->datasend("Please save this message!\n");
$smtp->datasend("This information is REQUIRED to add/modify/delete your account info!\n");
$smtp->datasend("Please let others know of this service!\n");
$smtp->datasend("Your ID, Password and E-Mail are:\n");
$smtp->datasend("Userid: $in{'userid'}\n");
$smtp->datasend("Pass: $in{'pw'}\n");
$smtp->datasend("E-Mail: $in{'Mail'}\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("Thank you for your time and good luck.\n");
$smtp->datasend("Your Name Here\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
}
The BCC: Function is not working correctly but the mail does go out.
You will also need to add a E-mail section to your creat an account screen.
------------------
Thanks in Advance
Daniel J.
www.blackrose.net
webmaster@blackrose.net
[This message has been edited by SirDaniel (edited January 31, 1999).]
# Add the userid into the file with default permissions.
Code:
open (PASS, ">>$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!"); if ($db_use_flock) {
flock(PASS, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
my $encrypted = crypt($in{'pw'}, $salt);
my $permissions = join (":", @auth_signup_permissions);
print PASS "$in{'userid'}:$encrypted:$permissions\n";
close PASS;
&html_signup_success;
open(LAST, ">>$latest") | | die $!;
print LAST "Userid: $in{'userid'}\n";
print LAST "Pass: $in{'pw'}\n";
print LAST "Email: $in{'Mail'}\n\n";
close(LAST);
use NET::SMTP;
$smtp = Net::SMTP->new('your.SMTPSERVER.net'); # connect to an SMTP server
$smtp->mail( 'yourname\@yourdomain.net' ); # use the sender's address here
$smtp->to($in{'Mail'}); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: $in{'Mail'}\n");
$smtp->datasend("From: yourname\@yourdomain.net\n");
$smtp->datasend("BCC: yourname\@yourdomain.net\n");
$smtp->datasend("Subject: Your Access Information\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Thank You for registering with us.\n");
$smtp->datasend("Please save this message!\n");
$smtp->datasend("This information is REQUIRED to add/modify/delete your account info!\n");
$smtp->datasend("Please let others know of this service!\n");
$smtp->datasend("Your ID, Password and E-Mail are:\n");
$smtp->datasend("Userid: $in{'userid'}\n");
$smtp->datasend("Pass: $in{'pw'}\n");
$smtp->datasend("E-Mail: $in{'Mail'}\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("Thank you for your time and good luck.\n");
$smtp->datasend("Your Name Here\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
}
The BCC: Function is not working correctly but the mail does go out.
You will also need to add a E-mail section to your creat an account screen.
------------------
Thanks in Advance
Daniel J.
www.blackrose.net
webmaster@blackrose.net
[This message has been edited by SirDaniel (edited January 31, 1999).]
Jan 31, 1999, 4:34 PM
Novice (21 posts)
Jan 31, 1999, 4:34 PM
Post #3 of 6
Views: 3981
SirDaniel,
Thank you very much for your answering to my post.
Unfortunately......that does not work ! : i have a 500 error.
Just a question what is this LAST file you refer to ?
Here is the code i have customized for my site. Do you see an error ?
I must add that i have a field for the email address : its name : Email, declared both in the config file and the form to create the record :
Here is the code
(i have commented the section with the LAST file, but it still doesn't work :
#open(LAST, ">>$latest") | | die $!;
#print LAST "Userid: $in{'userid'}\n";
#print LAST "Pass: $in{'pw'}\n";
#print LAST "Email: $in{'Email'}\n\n";
#close(LAST);
use NET::SMTP;
$smtp = Net::SMTP->new('mail.noosph.org'); # connect to an SMTP server
$smtp->mail( 'noosph\@noosph.org' ); # use the sender's address here
$smtp->to($in{'Email'}); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: $in{'Email'}\n");
$smtp->datasend("From: noosph\@noosph.org\n");
$smtp->datasend("BCC: noosph\@noosph.org\n");
$smtp->datasend("Subject: Your Access Information\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Thank You for registering with us.\n");
$smtp->datasend("Please save this message!\n");
$smtp->datasend("This information is REQUIRED to add/modify/delete your account info!\n");
$smtp->datasend("Please let others know of this service!\n");
$smtp->datasend("Your ID, Password and E-Mail are:\n");
$smtp->datasend("Userid: $in{'userid'}\n");
$smtp->datasend("Pass: $in{'pw'}\n");
$smtp->datasend("E-Mail: $in{'Email'}\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("Thank you for your time and good luck.\n");
$smtp->datasend("Parsifal\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
Thank you very much for your answering to my post.
Unfortunately......that does not work ! : i have a 500 error.
Just a question what is this LAST file you refer to ?
Here is the code i have customized for my site. Do you see an error ?
I must add that i have a field for the email address : its name : Email, declared both in the config file and the form to create the record :
Here is the code
(i have commented the section with the LAST file, but it still doesn't work :
#open(LAST, ">>$latest") | | die $!;
#print LAST "Userid: $in{'userid'}\n";
#print LAST "Pass: $in{'pw'}\n";
#print LAST "Email: $in{'Email'}\n\n";
#close(LAST);
use NET::SMTP;
$smtp = Net::SMTP->new('mail.noosph.org'); # connect to an SMTP server
$smtp->mail( 'noosph\@noosph.org' ); # use the sender's address here
$smtp->to($in{'Email'}); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: $in{'Email'}\n");
$smtp->datasend("From: noosph\@noosph.org\n");
$smtp->datasend("BCC: noosph\@noosph.org\n");
$smtp->datasend("Subject: Your Access Information\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("Thank You for registering with us.\n");
$smtp->datasend("Please save this message!\n");
$smtp->datasend("This information is REQUIRED to add/modify/delete your account info!\n");
$smtp->datasend("Please let others know of this service!\n");
$smtp->datasend("Your ID, Password and E-Mail are:\n");
$smtp->datasend("Userid: $in{'userid'}\n");
$smtp->datasend("Pass: $in{'pw'}\n");
$smtp->datasend("E-Mail: $in{'Email'}\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("Thank you for your time and good luck.\n");
$smtp->datasend("Parsifal\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
Feb 1, 1999, 4:14 AM
User (102 posts)
Feb 1, 1999, 4:14 AM
Post #4 of 6
Views: 3955
My apologizes, I forgot that that was there as well. It is a text file that is writen to th edir so that you will have a copy of the information they entered. In db.pl or db.cgi (which ever one you use.) add this line at the top.
$latest = $db_script_path . "/saveme.txt";
------------------
Thanks in Advance
Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Code:
# Get the information to send to them later if it is forgotten. $latest = $db_script_path . "/saveme.txt";
------------------
Thanks in Advance
Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Feb 3, 1999, 6:05 PM
User (102 posts)
Feb 3, 1999, 6:05 PM
Post #5 of 6
Views: 3997
I must also add that this is my set up on my Windows NT Server.. You also need to have libnet installed. You can get it at
http://www.perl.com/CPAN
Installing it is very easy.
------------------
Thanks in Advance
Daniel J.
www.blackrose.net
webmaster@blackrose.net
http://www.perl.com/CPAN
Installing it is very easy.
------------------
Thanks in Advance
Daniel J.
www.blackrose.net
webmaster@blackrose.net