Hello. I am trying to write a script which allows you to define i you want to be sent an e-mail after every submission. I have used the following;
$sendmasteremail = 0; # 1 is yes, 0 is no
$submitteremail = 1;
and the the following code in the main script;
#################################################
# CODE #
#################################################
sub send_webmaster
{
if ($sendmaster ne 0){
open (MAIL, "|$sendmail -t") or &dienice("Can't access $sendmail!\n");
print MAIL "To: $webmasteremail \n";
print MAIL "From: $email ($organization)\n";
print MAIL "Reply-to: $email \n";
print MAIL "Subject: Someone has just submitted a site.... \n\n";
print MAIL "Someone just used your submission service to submit $url\; \n";
close(MAIL);
} else { }
}
# This sub sends the e-mail to the user (if option is enabled)
sub send_submitter
{
if ($submitteremail ne 0){
open (MAIL, "|$sendmail -t") or &dienice("Can't access $sendmail!\n");
print MAIL "To: $email \n";
print MAIL "From: $webmasteremail ($org)\n";
print MAIL "Reply-to: $webmasteremail \n";
print MAIL "Subject: Thanks for using our submission service... \n\n";
print MAIL "Thanks for using our submission service to submit the following info to the top 17 search engines \n";
print MAIL " \n";
print MAIL "URL: $url \n";
print MAIL "Site Title: $organization \n";
print MAIL "Address: $address \n";
print MAIL "City: $city \n";
print MAIL "State: $state \n";
print MAIL "Country: $country\n";
print MAIL "Tel. No.: $phone \n";
print MAIL "E-Mail Address: $email \n";
print MAIL " \n";
print MAIL "Thanks for using our submission service, and be sure to visit us often \n";
print MAIL "at $home. \n";
close(MAIL);
} else { }
}
##################################################
# END OF CODE #
##################################################
Any help would be much appreciated.
Thanks
A.J.Newby
webmaster@ace-installer.com
http://www.ace-installer.com
$sendmasteremail = 0; # 1 is yes, 0 is no
$submitteremail = 1;
and the the following code in the main script;
#################################################
# CODE #
#################################################
sub send_webmaster
{
if ($sendmaster ne 0){
open (MAIL, "|$sendmail -t") or &dienice("Can't access $sendmail!\n");
print MAIL "To: $webmasteremail \n";
print MAIL "From: $email ($organization)\n";
print MAIL "Reply-to: $email \n";
print MAIL "Subject: Someone has just submitted a site.... \n\n";
print MAIL "Someone just used your submission service to submit $url\; \n";
close(MAIL);
} else { }
}
# This sub sends the e-mail to the user (if option is enabled)
sub send_submitter
{
if ($submitteremail ne 0){
open (MAIL, "|$sendmail -t") or &dienice("Can't access $sendmail!\n");
print MAIL "To: $email \n";
print MAIL "From: $webmasteremail ($org)\n";
print MAIL "Reply-to: $webmasteremail \n";
print MAIL "Subject: Thanks for using our submission service... \n\n";
print MAIL "Thanks for using our submission service to submit the following info to the top 17 search engines \n";
print MAIL " \n";
print MAIL "URL: $url \n";
print MAIL "Site Title: $organization \n";
print MAIL "Address: $address \n";
print MAIL "City: $city \n";
print MAIL "State: $state \n";
print MAIL "Country: $country\n";
print MAIL "Tel. No.: $phone \n";
print MAIL "E-Mail Address: $email \n";
print MAIL " \n";
print MAIL "Thanks for using our submission service, and be sure to visit us often \n";
print MAIL "at $home. \n";
close(MAIL);
} else { }
}
##################################################
# END OF CODE #
##################################################
Any help would be much appreciated.
Thanks
A.J.Newby
webmaster@ace-installer.com
http://www.ace-installer.com