SPUG: sending emails
Adrian Hands
AEH at akc.org
Tue Feb 20 15:42:43 PST 2007
print MAIL "Content-Type: text/plain; charset=\"utf-8\"\n";
> -----Original Message-----
> From: spug-list-bounces+aeh=akc.org at pm.org [mailto:spug-list-
> bounces+aeh=akc.org at pm.org] On Behalf Of luis medrano
> Sent: Tuesday, February 20, 2007 6:15 PM
> To: spug-list at pm.org
> Subject: SPUG: sending emails
>
> Hi,
>
> I have script to send emails but when I send a email with double byte
> characters it will send non-readible characters for example:
>
> 日本AV女優
> 维基百ç§',自ç"±çš„百ç§'全书
> 跳转到: 导航, �索
>
> Any of you knows how perl can respect the double byte charecters when
> it sends the email?
>
> here is the script:
>
> #!/bin/perl
> my $email_file="tot.txt";
> open (FILE, $email_file) or die;
> my @emails=<FILE>;
> close(FILE);
> my $content=shift(@ARGV) || die ("error:give the name of the file
> content");
>
>
> open (FILE, $content) or die;
> my @contents=<FILE>;
> close(FILE);
>
> print "subject of the email \n";
> my $title=<STDIN>;
> chomp($title);
> foreach my $line (@emails){
> chomp($line);
> my $random_number = int(rand(2));
> if ($random_number==1){
> #print $random_number . "\n";
>
> open (MAIL, "|/usr/sbin/sendmail -t ");
> print MAIL "From: posting\@mailserver\n";
> print MAIL "To: $line\@mailserver\n";
> print MAIL "Content-Type: text/plain\n";
> print MAIL "Subject: $title\n\n";
> print MAIL "@content";
> close (MAIL);
> }
> sleep(5);
> }
> print "done \n";
>
> Thanks,
> Luis
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
> POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
> MEETINGS: 3rd Tuesdays
> WEB PAGE: http://seattleperl.org/
More information about the spug-list
mailing list