in reply to Re: Sending HTML-formatted mail to a list
in thread Sending HTML-formatted mail to a list

I initally had this in my code, but changed it after thinking that instead of opening the MAIL filehandle on every interation of the loop, I'd open MAIL once, loop thru all the addresses, then close the filehandle. Is that wrong?

"Do or do not--there is no try." --Yoda
  • Comment on Re: Re: Sending HTML-formatted mail to a list

Replies are listed 'Best First'.
Re: Re: Re: Sending HTML-formatted mail to a list
by dvergin (Monsignor) on Dec 17, 2001 at 04:03 UTC
    Chady underestimates his grasp of the problem. Yes, the second and third emails are getting lost in some sort of HTML-mail muddle as useless additions to the body of the first email. You must close and re-open the sendmail pipe to send subsequent emails.

    Or include all three addresses on the "To:" line and send them all at once.

    ------------------------------------------------------------
    "Perl is a mess and that's good because the
    problem space is also a mess.
    " - Larry Wall

      Thanks--you totally helped me. After cleaning up the syntax, I did a test to find a single element in the array:
      foreach $address (@address) { print "$address\n"; }
      From this, I found that $address is all of my addresses in the test file (three entrys). So it thinks that all three addresses correspond to one array element!
Re: Re: Re: Sending HTML-formatted mail to a list
by Chady (Priest) on Dec 16, 2001 at 23:20 UTC

    I'm not really sure, but I think that you need to close sendmail so it can send the email, or else, it will keep on printing the text in the body of the current email, and that's why you're getting only the first email sent.. because the rest of the emails are just body in the first one.

    then again, I might be wrong.


    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/