anya5112004
02-06-2005, 06:12 PM
Hi,
I created a sendmail cgi script using Net::SMTP and it's working fine. I use the MIME::Entity to build the content entered in the form (To:, CC:, Subject:, Body, etc.).
Currently, what I'm trying to do is to create a simple version that allows any user of the script to use it with any type of form they already have. The script will retrieve the chosen/entered data in the form and send it to a recipient email address specified in the script. So the body of the message should contain the name-value pairs from the form. I want the script to be used with any kind of form, regardless of how many or what form fields the user of the script already has. In other words, a generic mailto script.
I'm relatively new to CGI, and I know that the param('fieldName') is what is primarily used to retrieve form data and use it in your script. However, what if you won't know what the 'filedName' is since my intention is for people to use the script without the need of editing it, but simply by calling it from their form.htm. How can I write code that will cycle through the form elements and get it's value (something like accessing the collecions property), and then display it on the body of the message (hopefully, in a not so cryptic-looking format).
Thanks in advance for the help.
MarkT2
I created a sendmail cgi script using Net::SMTP and it's working fine. I use the MIME::Entity to build the content entered in the form (To:, CC:, Subject:, Body, etc.).
Currently, what I'm trying to do is to create a simple version that allows any user of the script to use it with any type of form they already have. The script will retrieve the chosen/entered data in the form and send it to a recipient email address specified in the script. So the body of the message should contain the name-value pairs from the form. I want the script to be used with any kind of form, regardless of how many or what form fields the user of the script already has. In other words, a generic mailto script.
I'm relatively new to CGI, and I know that the param('fieldName') is what is primarily used to retrieve form data and use it in your script. However, what if you won't know what the 'filedName' is since my intention is for people to use the script without the need of editing it, but simply by calling it from their form.htm. How can I write code that will cycle through the form elements and get it's value (something like accessing the collecions property), and then display it on the body of the message (hopefully, in a not so cryptic-looking format).
Thanks in advance for the help.
MarkT2