I am using formmail.pl and a submit.shtml form to get users to opt-in to my nesletter.
The thing I want to do is add functionality so that the user gets an automatic reply with their downloadlink.
As it stand now, they just get forwarded to the download page, which makes it easy for them to use a fake email address.
This is what I was told to add to the formmail.pl
# open a message to the remote client
open (MAIL, "|$mailprog $FORM{'username'}") || die "Can't open $mailprog!\n";
print MAIL "To: $FORM{'username'} ($FORM{'realname'})\n";
print MAIL "Reply-To: $FORM{'recipient'}\n";
print MAIL "From:
$FORM{'recipient'}\n";
print MAIL "Subject: $FORM{'subject'}\n\n";
# write out a customized response to the mail message
print MAIL "We have received your message and are delighted";
print MAIL "you have requested information about our products.";
print MAIL "Here is the information you requested - ";
print MAIL "Product 1. - info about product 1";
print MAIL "Product 2. - info about product 2";
print MAIL "Product 3. - info about product 3";
print MAIL "Product 4. - info about product 4";
print MAIL "Product 5. - info about product 5";
print MAIL "Yours truly, John Doe, sales rep.";
# close the message
close (MAIL);
exit;
}
And this is what my form looks like.
<table border="1" bordercolor="maroon">
<tr>
<td>
<p>
<form action="/cgi-bin/FormMail.
pl" method="get">
<input type=hidden name="required" value="realname,username">
<input type="hidden" name="recipient" value="me@mydomain.com"><i
nput type="hidden" name="subject" value="Mailing list entry"><input type="hidden" name="redirect" value="
http://www.mydomain.com/thankyou.htm">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Your Name:</td>
<td><input type="text" name="realname" / size="20"></td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="text" name="username" / size="20"></td>
</tr>
<tr>
</table>
<br>
<br>
<input TYPE="submit" NAME="send" VALUE="Download the software" class="button" style="font-family:Arial,s
erif; font-style:normal; font-weight:normal; font-size:10pt; color:white; text-align:center; background-color:maroon;">
<input TYPE="reset" VALUE="Clear form" class="button" style="font-family:Arial,s
erif; font-style:normal; font-weight:normal; font-size:10pt; color:white; background-color:maroon;">
</p>
</form></td>
</tr>
</table>
When i fill out the form on the website, i do get an email from the user (me, for testing.) but i do not get an autoreply.
What am i doing wrong?
Start Free Trial