PDA

View Full Version : Getting form submitter's email address to show up


monique
03-02-2005, 01:10 AM
Hi All,

Wondering if anyone else has encountered this problem with an html form that uses FormMail.pl version 1.92. I've got a form that requires the submitter to enter his/her email address into a form field, and once the user hits "Submit" and the form field data is emailed to me, his/her email address doesn't show up in the email (you basically get an email from a blank sender). ** I need the form submitter's email address to show up in the body of the email as part of the form results, AND in the 'from' area of an email (so you can reply to it)**. When I tried to mess around with the form to see if I could get the email address to show up, it will either show up as a form field in the body of the email (as form results) but will be from a 'blank' sender, or vice versa. I can't get the submitter's email address to show up in both places.

If anyone can point me in the right direction for a solution, I'd really appreciate it. My ISP doesn't have any idea how to help and I'm at my wits end! :confused:

Here's the snippet from my FormMail.pl file (if this won't suffice, let me know):

$mailprog = '/usr/lib/sendmail -i -t';

@referers = ('vancondo.com','www.vancondo.com','localhost');

@recipients = ('moniquecornish@telus.net');

@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');


and, here's the html markup for my form:


<FORM action="http://www.vancondo.com/cgi-bin/FormMail4.pl" method="post" name="Online Banking Registration" id="Online Banking Registration" onSubmit="MM_validateForm('sender_email','','RisEmail','strata_plan','','R','bldg_address','','R','unit','','R ','owner_registered_name','','R');return document.MM_returnValue">
<P>
<INPUT type=hidden value=moniquecornish@telus.net name=recipient>
<INPUT type=hidden value="Online Banking Registration" name=subject>
<INPUT type=hidden value=http://www.vancondo.com/onlinebank/thanks_reg_new.htm name=redirect>
<INPUT type=hidden value=REMOTE_HOST,HTTP_USER_AGENT name=env_report>
</P>
<table width="100%%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#CCCCCC">
<td colspan="3" class="TopTitle">Online Banking Registration
Form<br> <br> </td>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1" height="3">&nbsp;</td>
<td height="3" class="normaltext">&nbsp;</td>
<td height="3">&nbsp;</td>
<td width="5" height="3">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext"><font color="#000099">(*=
<font color="#000066" size="1">required field)</font></font></td>
<td width="174">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td>&nbsp;</td>
<td class="normaltext" valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td>&nbsp;</td>
<td class="normaltext" valign="top"><font color="#000099">*</font>
Your Email Address:</td>
<td valign="top"><input name="email" type="text" id="email" onBlur="MM_validateForm('email','','RisEmail');return document.MM_returnValue"></td>
<td>&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td class="normaltext" valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext" valign="top"><font color="#000099">*</font>
Strata Plan #:</td>
<td width="174" valign="top"> <input name="strata_plan" type="text" id="strata_plan" onBlur="MM_validateForm('strata_plan','','R','bldg_address','','R','unit','','R','owner_registered_name','', 'R');return document.MM_returnValue">
</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext">&nbsp;</td>
<td width="174">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext" valign="top"><font color="#000099">*</font>
Building Address:</td>
<td width="174" valign="top"> <input name="building_address" type="text" id="building_address" onBlur="MM_validateForm('bldg_address','','R');return document.MM_returnValue"></td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext">&nbsp;</td>
<td width="174">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext" valign="top"><font color="#000099">*</font>
Unit #:</td>
<td width="174" valign="top"> <input name="unit" type="text" id="unit" onBlur="MM_validateForm('unit','','R');return document.MM_returnValue" size="10" maxlength="10"></td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td class="normaltext">&nbsp;</td>
<td>&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext"><font color="#000099">*</font>
Owner Name Registered on Title <br>
(First Name, Last Name): </td>
<td width="174"><input name="owner_registered_name" type="text" id="owner_registered_name" onBlur="MM_validateForm('owner_registered_name','','R');return document.MM_returnValue"></td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td class="normaltext" valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext" valign="top">Name of Person
Making Payments:<br> <font size="1"><em>(required if person
making payment is not the registered owner)</em></font></td>
<td width="174" valign="top"><input type="text" id="person_making_payment" name="person_making_payment">
</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext">&nbsp;</td>
<td width="174">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td colspan="2" valign="top" class="normaltext">Please note
that your VCS Online Banking Registration Code along with
a current account statement for your unit will be mailed
to the address on record for the unit in question.</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext">&nbsp;</td>
<td width="174">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext" align="center"> <input type="submit" name="Submit" value="Submit">
</td>
<td width="174"> <input type="reset" name="Reset" value="Reset">
</td>
<td width="5">&nbsp;</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="1">&nbsp;</td>
<td width="221" class="normaltext">&nbsp;</td>
<td width="174">&nbsp;</td>
<td width="5">&nbsp;</td>
</tr>
</table>
</form>

mlseim
03-02-2005, 01:58 PM
Did you alter the script, like the way you did here?

('sender_email','','RisEmail','strata_plan','','R','bldg_address','','R','unit','','R ','owner_registered_name','','R');return document.MM_returnValue">


The script is looking for the variable 'email' as the email that was
entered by the person who sent it.

Did you modify the script to look for 'sender_email' ... as you have done in the line above?

Try changing all references to 'email' and see what happens.


.

monique
03-02-2005, 08:01 PM
Thanks so much for your reply.

After I posted last night, I changed my form field name to be called just 'email' because I had a feeling that the script would look for that name as the default and plug that into the 'from' area of the email. However, once I did this and tested it, my email address showed up as the sender (submitter) of the form but the form field called 'email' didn't even show up in the body of the email. It left it out completely.

Is there some other modification I need to make to the script in order to make the sender's email address show up in both places (within form results and in the 'from' area of the email)?? I'm an idiot with scripts so if you have an idea/instruction, could you lay it out for me, step by step? I can post more of the script if you like...

muchos gracias,
monique :)

mlseim
03-02-2005, 08:06 PM
Save a copy of your script as a text file "FormMail.txt"
and then attach it to a post on here ... that way I can see
the whole script. You'll see the attachment part when you
post a reply (... "manage attachments")

monique
03-02-2005, 10:15 PM
Here's the script, saved as a .txt file.

thanks!

mlseim
03-02-2005, 10:56 PM
Boy ...

I just don't see anything wrong.

I'm assuming you're testing it with the correct form?
(I see you have 3 forms in the process)
_banking.htm
_banking_new.htm
_banking_new2.htm <-- is this the latest one? The one you test with?

And, the other forms on the site are working properly?
like: FormMail2.cgi?

My only suggestion is to take FormMail2.cgi and copy
it as FormMail4.cgi ... start over again.

I'm not sure how many things you've changed in FormMail4.cgi

It's just strange why it does not work.

--max--

monique
03-02-2005, 11:19 PM
yup... I'm testing it with the correct form! all other forms on the site are indeed working, though the FormMail4.pl script is an updated version (though the previous version wasn't working either - that's why I updated).

i actually emailed matt wright at scriptarchive.com (author of the FormMail.pl script) to see if he had any ideas but haven't received any response (not surprising... i bet he's a busy guy).

i have one last question for you - in the following snippet of html from my form, do you know what the meaning of 'RisEmail' is after 'sender_email' ? just curious...

('sender_email','','RisEmail','strata_plan','','R','bldg_address','','R','unit','','R ','owner_registered_name','','R');return document.MM_returnValue">

i'm going to try and modify my older perl FormMail script to see if I can get it to do what i want, and then i'll start from scratch on the html side. very strange indeed.

thanks for looking at this for me... much appreciated.

netroact
03-06-2005, 06:56 PM
Did you ever get your script working? You really don't need anything that complex. Just make sure to use the switches, and check the referrerr. If you still need help, email me and I will make you a script.

monique
03-07-2005, 10:08 PM
Hi there,

Thanks for your post/reply. I haven't been able to get the email address to show up in both places ('from' header and in body of email as form results). I have been in touch with my ISP and their written response was...

"The 'From' field will always be blank. The reason it does this is because
it is sending the email notification straight from the server, so if it
wasn't blank it would show something like server@web50.radiant.net. That is
why it is imperative that you have them enter their email address into a
field. The reason we script the server to leave it blank is because then
people can't respond to it and the server doesn't bog down with reply emails
it doesn't know what to do with."

I don't know if anything can be done as a work-around, but I'm all ears!

Thanks again,
Monique

mlseim
03-08-2005, 12:47 AM
Monique ....

But your OTHER forms work OK don't they?

Are they not in the same CGI-BIN on your same server?

netroact
03-08-2005, 01:17 AM
I ran your script with my poop in it, and it displayed the email in both places just fine. Maybe I am misunderstanding what the server people are telling you, but the user is entering the email into a form field, so that wouldn't even make sense. Unless, they are saying have them enter their email into a field to be displayed in the body only. But, that's not what they wrote.

It appears that they misunderstood your question. I am sure that if they wrote a script, it would check to see if the email field was populated. If not, make it blank, instead of allowing the server email address to display.

When you test the script, are you using the same email address in the email form field, that you are using as the recipient? Sometimes that causes problems.