in reply to Sending email with Net::SMTP

I have to say I feel you're confused. Or maybe I am. If you have some email addresses coming in from a checkbox group, what more do you need?

I don't understand, from the map and grep stuff, what the point of your script is at that part.

If you have to send email to everyone in param("m_EmailGroups"), then split it on \0 and print it to the mail program. You obviously want to do something more complex? Please explain.



“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

Replies are listed 'Best First'.
Re: Re: Sending email with Net::SMTP
by Anonymous Monk on Jul 14, 2003 at 23:28 UTC
    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..
      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);