home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
Pavilions
/
BrainOpera
/
cgi-bin
/
text
/
mail-utilities
< prev
next >
Wrap
Text File
|
2017-09-21
|
1KB
|
46 lines
#!/usr/local/bin/perl
# Script written by Ben (benjamin@media.mit.edu) to mail stuff using
# a CGI script
# This procedure mails to someone
# It takes as arguments, in this order :
# sender_name, sender_email, recipient_name, recipient_email,
# subject, message, user_info
sub mailer {
chop(local($date)=`date`);
local($sender_name)=$_[0];
local($sender_email)=$_[1];
local($recipient_name)=$_[2];
local($recipient_email)=$_[3];
local($subject)=$_[4];
local($message)=$_[5];
local($user_info)=$_[6];
open(mail,"| /bin/mail $recipient_email");
print mail "From: \"WEB FORM: $sender_name\" <$sender_email>\n";
print mail "To: \"$recipient_name\" <$recipient_email>\n";
print mail "Subject: $subject";
print mail "\n\n";
print mail "DATE : $date \n";
print mail "USER INFO:\n$user_info\n\n";
print mail "MESSAGE:\n$message\n";
close(mail);
}
sub mailer_user {
local($sender_name)=$_[0];
local($sender_email)=$_[1];
local($recipient_name)=$_[2];
local($recipient_email)=$_[3];
local($subject)=$_[4];
local($message)=$_[5];
open(mail,"| /bin/mail $recipient_email");
print mail "From: \"$sender_name\" <$sender_email>\n";
print mail "To: \"$recipient_name\" <$recipient_email>\n";
print mail "Subject: $subject";
print mail "\n\n";
print mail "$message\n";
close(mail);
}