Multiple email recipients using NMS Formail

Discussion in 'Perl Misc' started by Adam, Jun 30, 2004.

  1. Adam

    Adam Guest

    Hi,

    I am using Version 3.12c1 of NMS FormMail.

    I am unable to get the script to post to mulitple email accounts.
    The mail will only get sent to the first email account
    in the '@allow_mail_to' array.

    How can I have the mail forward on to multiple accounts ?

    The script is standard apart from some formatting changes to the
    generated html.

    [snip]
    $max_recipients = 5;
    $mailprog = '/usr/lib/sendmail -oi -t';
    $postmaster = '';
    @referers = qw(mydomain.com);
    @allow_mail_to = qw( );
    @recipients = ();

    [snip]

    The init_allowed_address_list function is unchanged.

    [snip]

    sub init_allowed_address_list {
    my ($self) = @_;

    my @allow_mail = ();
    my @allow_domain = ();

    foreach my $m (@{ $self->{CFG}{allow_mail_to} }) {
    if ($m =~ /\@/) {
    push @allow_mail, $m;
    }
    else {
    push @allow_domain, $m;
    }
    }

    my @alias_targets = split /\s*,\s*/, join ',', values %{
    $self->{CFG}{recipient_alias} };
    push @allow_mail, grep /\@/, @alias_targets;

    # The username part of email addresses should be case sensitive, but
    the
    # domain name part should not. Map all domain names to lower case
    for
    # comparison.
    my (%allow_mail, %allow_domain);
    foreach my $m (@allow_mail) {
    $m =~ /^([^@]+)\@([^@]+)$/ or die "internal failure [$m]";
    $m = $1 . '@' . lc $2;
    $allow_mail{$m} = 1;
    }
    foreach my $m (@allow_domain) {
    $m = lc $m;
    $allow_domain{$m} = 1;
    }

    $self->{Allow_Mail} = \%allow_mail;
    $self->{Allow_Domain} = \%allow_domain;
    }

    [snip]

    Thanks in advance,
    Adam
     
    Adam, Jun 30, 2004
    #1
    1. Advertising

  2. Adam wrote:
    > I am using Version 3.12c1 of NMS FormMail.
    >
    > I am unable to get the script to post to mulitple email accounts.


    Doesn't the documentation explain how you do that?

    > The mail will only get sent to the first email account
    > in the '@allow_mail_to' array.
    >
    > How can I have the mail forward on to multiple accounts ?
    >
    > The script is standard apart from some formatting changes to the
    > generated html.
    >
    > [snip]
    > $max_recipients = 5;
    > $mailprog = '/usr/lib/sendmail -oi -t';
    > $postmaster = '';
    > @referers = qw(mydomain.com);
    > @allow_mail_to = qw( );
    > @recipients = ();


    What's the purpose of the @recipients array?

    Note that this group is not the right place to seek help with
    configuring a script. If the docs isn't sufficient, asking the authors
    is the natural next step.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Jul 2, 2004
    #2
    1. Advertising

  3. Gunnar Hjalmarsson <> wrote:
    > Adam wrote:
    >> I am using Version 3.12c1 of NMS FormMail.

    > Note that this group is not the right place to seek help with
    > configuring a script. If the docs isn't sufficient,


    The EXAMPLES file has a section entitled:

    EXAMPLE 3: Copies to multiple recipients

    which explains how to do this.

    > asking the authors
    > is the natural next step.
    >


    The appropriate place to get support for any NMS programs is at the
    mailling list at:



    /J\
     
    Jonathan Stowe, Jul 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. .Net Newbie

    Single email to multiple recipients

    .Net Newbie, Jun 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    9,426
    .Net Newbie
    Jul 1, 2004
  2. Alex Hunsley
    Replies:
    2
    Views:
    873
    Paul Wright
    Jul 1, 2004
  3. Replies:
    1
    Views:
    397
    Rene Pijlman
    Feb 20, 2006
  4. dmiller23462

    Multiple Email Recipients depending on Value

    dmiller23462, Oct 28, 2004, in forum: ASP General
    Replies:
    4
    Views:
    256
    dmiller23462
    Nov 16, 2004
  5. Matěj Cepl
    Replies:
    0
    Views:
    88
    Matěj Cepl
    Jan 9, 2014
Loading...

Share This Page