in reply to Re: Re: Mail::Sender trouble
in thread Mail::Sender trouble

You should put <code> tags around it. Anyway, you're reading the file into @mailf, but each of the lines have newlines at the end. Including your filename. Instead, you may want to do this:

open(FILE, $mail); @mailf = map { chomp; $_ } <FILE>; close(FILE); # now process $mail[n]

update: fixed map. Actually you could just go:

@mailf = <FILE>; chomp(@mailf);

Replies are listed 'Best First'.
Re: Re: Re: Re: Mail::Sender trouble
by Dalin (Sexton) on Jun 06, 2001 at 00:14 UTC
    When I tried that I got 1's for the printing of the input strings. Should this be??? Also did not receive the mail. Sorry about the code thing... I'll get used to it I think. I have a feeling I'll be visiting here often. Dalin
Re: Re: Re: Re: Mail::Sender trouble
by Dalin (Sexton) on Jun 06, 2001 at 00:27 UTC
    That worked! Thank you. But... don't you love the butt's??? The variables are being taken literally and I get "$addr@hostname.com". and the file names where there should be the files themselves instead. I am doing something wrong here??? (Well, obviously I am.) Thanks again. Dalin
      Watch your quotes. I see you have '$addr' somewhere. The single quotes prevent $addr from being interpreted. You don't need to use quotes at all to use the contents of a variable. You can just say $addr rather than "$addr"; and don't use '$addr' if you want the value of the variable to be used. As far as the filenames instead of the files, well, you may have to read the contents of the files; I don't know about the API of Mail::Sender.
        The mail is now working, but I'm still having some trouble with the variables, but I think I should be able to figure it out. I want to thank you and cacharbe for your help. I have been hearing about the whole opensource community thing and have not yet had the opportunity to experience it. I'll be sticking around here I think and I hope to meet a lot of people and learn a lot of things...(as I already have). Thanks. Dalin