develooper Front page | perl.perl5.porters | Postings from July 2000

SendMail

Thread Next
From:
Antônio Jozzolino
Date:
July 26, 2000 05:31
Subject:
SendMail
Message ID:
NDBBKLNDOBKFLBJMEJNNEEAMCIAA.info@sgd.com.br
Hi
I am a beginner in Perl and I am having problems below with the program. I
am receiving this error of the server and I don't have access to the log
file. You , experienced programmers, could help me?

PS: Although the error happens, the messages are usually sent.


Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your
request.

Please contact the server administrator, site22 and inform them of the time
the error occurred, and
anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



#!/usr/bin/perl -w

# What mail program we are using
$mailprog = '/usr/sbin/sendmail';
# Our email text file (this contains all of the email addresses)
# For more detail, see http://www.4GuysFromRolla.com/linux/addemail.txt
$infile = '/home/sites/site22/web/subscribe/address/001.txt';
# The email file.  This contains the message we want to send to everyone
$emailfile = '/home/sites/site22/web/subscribe/message/001.txt';

$assunto = 'VII Encontro Nacional de Higienistas Ocupacionais';
$sender = "lista\@abho.com.br";
$sender_name = 'ABHO - Associação Brasileira de Higienistas Ocupacionais';

&iterate_email_list;

&send_away;

sub top {
	print MAIL"
ATENÇÃO: ESTA MENSAGEM DIZ RESPEITO A HIGIENE OCUPACIONAL.
**********************************************************************
Se você não está relacionado com este assunto, pedimos a gentileza de
interromper
imediatamente a leitura deste e-mail e solicitar a remoção do seu e-mail,
acessando:
http://www.abho.com.br/cgi-bin/subscribe.pl?email=$recepient&subscribe=unsub
scribe
Agindo assim, garantimos que você não tornará a receber qualquer comunicado
nosso.
Obrigado pela sua atenção e desculpe pelo incômodo.

ATTENTION: THIS MESSAGE IS ABOUT OCCUPATIONAL HYGIENE.
**********************************************************************
If you are not related with this subject, we asked the gracefulness of
interrupting
Immediately the reading of this e-mail and to request the removal of its
e-mail, go to:
http://www.abho.com.br/cgi-bin/subscribe.pl?email=$recepient&subscribe=unsub
scribe
Acting like this, we guaranteed that you wouldn't turn to receive any our
release.
Thank you for its attention and excuse for the uncomfortable.
**********************************************************************\n\n\n
\n";
}

sub assinatura {
	print MAIL "\n\n\n
======================================================
ABHO - Associação Brasileira de Higienistas Ocupacionais
CX Postal 3066 Campinas, SP, Brasil, CEP 13033-990
E-mail: abho\@abho.com.br
E-mail: VIIencontro\@abho.com.br
Web Site: http://www.abho.com.br
ICQ 57272862
Fone/FAX: +55 019 242 6946

***PORTUGUESE***--------------------------------------
SE DESEJA SAIR DESTA LISTA, ACESSE O SEGUINTE ENDEREÇO:
http://www.abho.com.br/cgi-bin/subscribe.pl?email=$recepient&subscribe=unsub
scribe
SE, NO FUTURO, DESEJAR RETORNAR, ACESSE O SEGUINTE ENDEREÇO:
http://www.abho.com.br/cgi-bin/subscribe.pl?email=$recepient&subscribe=subsc
ribe
DIFICULDADES COM ESTES LINKS? ACESSE:
http://www.abho.com.br

***ENGLISH HERE***------------------------------------
IF YOU WANT TO GET OUT OF THIS LIST, GO TO:
http://www.abho.com.br/cgi-bin/subscribe.pl?email=$recepient&subscribe=unsub
scribe
IF YOU WANT TO GET IN OF THIS LIST, GO TO:
http://www.abho.com.br/cgi-bin/subscribe.pl?email=$recepient&subscribe=subsc
ribe
HAVE DIFFICULTIES WITH THESE LINKS? GO TO:
http://www.abho.com.br
------------------------------------------------------";

}


sub iterate_email_list
{
	# Open the list of emails file
	open(EMAILLIST,"$infile") or die "Can't open email list file ($infile)!";
	@RECEPIENTS = <EMAILLIST>;
	close(EMAILLIST);

	# Open the Email
	open(EMAIL,"$emailfile") or die "Can't open email file ($emailfile)";
	@EMAILMESSAGE = <EMAIL>;
	close(EMAIL);

	# Loop through for each line in our list of emails file
	foreach $recepient (@RECEPIENTS) {
		# Open a pipe to our mail program
		open(MAIL,"|$mailprog -t");

		# Get the recepient for this email
		chop($recepient);

		print MAIL "To: $recepient\n";
		print MAIL "From: $sender_name<$sender>\n";
		print MAIL "Subject: $assunto\n";
		print MAIL "Importance: Normal\n";
		print MAIL "Precedence: bulk\n\n";

		&top;

		# Print the body of the email message
		foreach $line (@EMAILMESSAGE) {
			print MAIL "$line";
		}

		&assinatura;

		close(MAIL);
	}
}


sub send_away {
	#$total = @RECEPIENTS;
	#print "Content-type: text/html\n\n";
	#print "Enviados $total e-mails\n";
	print "Location: http:\/\/www.abho.com.br\n\n";
}

Antonio Jozzolino


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About