سؤال

I am using FormMail.pl version 1.93 for form submission. I have asked this question before for FormMail 3.14m1 but now I am using FormMail.pl version 1.93

I have a single contact-us form and what I would like to do is use this single form such as contactus.html (not multiple copies of this form) everywhere on my website as my site has different contact-us sections based on the department.

Let's say the contact-us form for marketing should email to technical@mydomain.com, contact-us form for sales should email to sales@mydomain.com, HR's contact-us form should email to hr@mydomain.com.

How can I use the single form while redirecting the submission to the appropriate department email address?

I am using FormMail.pl Version 1.93 for email submission

هل كانت مفيدة؟

المحلول

FormMail 1.93 seems to be the version from Matt's Script Archive. The programs from that site are badly written, potentially buggy and (as you have, no doubt, discovered for yourself) unsupported. Even Matt Wright himself no longer recommends their use.

You would be better advised to use the versions from the nms project. It sounds like you were using nms' version 3.14m1, but stopped for some reason. Why is that?

No matter which version you use, your problem is basically the same. In pretty much any version of FormMail the email recipient is either hard-coded in the program or derived from a form input (often a hidden form input) on the HTML page. If you're using the same installation of the program for different email addresses you can't hard-code the address within the program (for, hopefully, obvious reasons). So you're left with getting the address from the HTML page.

But you say you want to use the same form for different contact addresses. I'm not sure how you think this is going to work. How does the form know how it is being used? Are you perhaps embedding the form within various pages using iframes? I suppose it might be possible to change the value of the recipient form input depending on how the form is being accessed. You'd need to do this with Javascript.

The recommended way to approach this is to have a single copy of the FormMail program which is called from several different HTML forms.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top