in reply to Re: Sending email with Net::SMTP
in thread Sending email with Net::SMTP

Hi There! Thanks for your input... What I'm trying to do is - I have a HTML form that has multiple checkboxes...i.e. Checkbox1, name=m_EmailGroups, and Value=user1. There's also checkbox2,3,4,5,6,7,8,9. All with the same name (m_EmailGroups) but different value. I want the user, when completing filling out the form to press send, and base on his check box selection an email should be sent to the user he has chosen... I tried creating a hash, and base on his checkbox selection in the HTML form, it would pull the value and send an email based on that... Hope this sheds some light on what I'm trying to do..Right now I'm totally confused and don't know that to do next..

Replies are listed 'Best First'.
Re: Re: Re: Sending email with Net::SMTP
by Cody Pendant (Prior) on Jul 14, 2003 at 23:42 UTC
    If you've got your email addresses from CGI.pm, then they should be concatenated into one long string with the \0 character in between items, unless I'm crazy.

    So you can make an array out of that param with

    @addressees = split('\0' $q->param($m_EmailGroups))

    or whatever.

    But it also sounds like you only ever expect them to choose one addressee? In that case you need Radio Buttons, not checkboxes, and you don't need to process it at all.



    “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
    M-J D
      Yes, they should be able to choose more than one email address to sent to. The radio button will only limit to one. I will try to concatenate the address into one long string and pull it from there.
      @addressees = split('\0' $q->param($m_EmailGroups)) $smpt->recipient(@addressess);
        Well that should do it.

        Just to point out though, they're already concatenated. CGI.pm does that for you.



        “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
        M-J D