Email Perl Script Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dandaman2007
    New Member
    • Apr 2007
    • 1

    Email Perl Script Issue

    Hi All,

    I need some expertise Perl help.....

    Basically i have an Email perl script that i use on alot of my sites, which basically E-mails the filled in form to a specified e-mail address. nms_formail.pl is the name of the perl script, in case anyone has got it themselves.

    I now need to change it slightly, but don't know how to......

    I want to be able to email the form to different address depending on what email address is selected on the form using a tick box.

    FOR EXAMPLE

    <input type="checkbox" name="Emial1" value="mailto:t est@test.com">
    <input type="checkbox" name="Email2" value="mailto:t est2@test2.com" >
    <input type="checkbox" name="Email3" value="mailto:t est3@test3.com" >

    The code is wrong for those tick boxes, but you get the idea,

    So when a user selects 2 of the text boxes, the email gets sent to those select tick boxes ONLY, and not the deselected on.



    If anyone could shine some light on this, that would be great. If you would like me to pose the script text of the perl script please say so and i will.

    Thanks again
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Have you tried the nms support forum? I know that many questions go unaswered there but yours might not. That would be the place to start since those guys and gals know the script forwards and backwards. Or hire a programmer for a modest fee to customize the script and make sure the changes are safe and work properly.

    As a side not, I would not put any email addresses in the html form. I believe the script documentation explains a way you can do that.

    Comment

    • davidiwharper
      New Member
      • Mar 2007
      • 20

      #3
      I did something vaguely similar [doing conditional things in the script based off a web form's checkbox] last year for a study project. While I didn't do emails based off of it the basic idea is the same. YMMV.

      Code:
      # define the email addresses in Perl so they are safer from prying eyes
      
      $my email1Destination = 'example1@domain.com';
      $my email2Destination = 'example2@domain.com';
      $my email3Destination = 'example3@domain.com';
      
      # now grab the input from the checkboxes
      
      if (my $email1 = param('Email1')) { # if the checkbox "Email1" is selected, do this
      
      	# send the email to $email1Destination
      
      }
      
      if (my $email2 = param('Email2')) {
      
      	# send the email to $email2Destination
      
      }
      
      if (my $email3 = param('Email3')) {
      
      	# send the email to $email3Destination
      
      }
      David

      Comment

      Working...