[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] Filereading into $addresses scalar / simpleproblem?



Your problem is here:
>$bcc = @lines;

This assigns $bcc the number of elements in @lines.
So in your example you are trying to send a mail to "4" which
obviously doesn't work.

You could e.g.
- change datafile and have no trailing comma
- open(INFO,$datafil)
- while(<INFO>) { chomp; $bcc = join( ", ", $_ ) }
- close( INFO )

before sending just check whether $bcc looks like
"nom1@xy.com, nom2@za.com"


Good luck,
Axel


At 18:00 Uhr +0200 15.05.2000, Jimmy Lantz wrote:
>Hi I'm using the Mail::Sendmail program and I'm trying to take
>emailaddresses from a textfile (see below)
>But it wont work, Any ideas??
>It says there's no recipent.
>
>Pls help me.
>Jimmy Lantz
>
>$meddelande ="Hello and goodbye";
>$amne ="Hello and goodbye";
>############################
>#Make Mail
>use Mail::Sendmail;
>%mail = (  Bcc	=> "$bcc",												From   =>
>'webmaster@ostas.lu.se',								Message => "$meddelande",
>		Subject => "$amne"
>								);
>sendmail(%mail) or die $Mail::Sendmail::error;
>&do_reply;
>exit;
>
> 
>sub do_bcc
>{
>open(INFO, $datafil);
>@lines = <INFO>;
>close(INFO);		
>$bcc = @lines;
>}
>
>
>###############The datafile contents##########
>webmaster@ostas.lu.se,
>webmaster@ostas.lu.se,
>webmaster@ostas.lu.se,
>webmaster@ostas.lu.se,
>
>==== Want to unsubscribe from this list?
>==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org

-- 
----------------------------------------------------------------------
Axel Rose, Springer & Jacoby Digital GmbH & Co. KG, mailto:rose@sj.com
  pub PGP key 1024/A21CB825 E0E4 BC69 E001 96E9  2EFD 86CA 9CA1 AAC5
  "... denn alles, was entsteht, ist wert, daß es zugrunde geht ..."

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org