I decided to repost this to try and make it clearer as it's driving me nuts.
I am trying to get a form to submit the users email to the FromAddress function.
The form I am using did not have any editable text fields in, it is a details page for users to check details. I could not get these fields to submit to the email so I created hidden text fields with Sessions in.
<input name="firstname" type="hidden" id="firstname" value="<%=(session1.Fields.Item("firstname"
.Value)%>">
<input name="email" type="hidden" id="email" value="<%=(session1.Fields.Item("email"
.Value)%>">
This works but I still can’t get the email field to work with this piece of code. The email and firstname are submitted to the body of the text okay.
<%
fromName="Bphf.com"
fromAddress="info@bphf.com"
toName="jeremy"
toAddress=Request.Form("email"
<<<<<<<<<<<<<<
subject="BPHF Membership"
relay="192.168.1.7"
%>
I have tried to put RESPONSE (“email”) as suggested in my previous post. I have also tried taking out – in the names.
The Code
Details.asp
<%
fromName="Bphf.com"
fromAddress="info@bphf.com"
toName="jeremy"
toAddress=Request.Form("email"
<<<<<<<<<<<<<<
subject="BPHF Membership"
relay="192.168.1.7"
%>
-
-
-
<form action="form_response.asp" method="post" name="form1" onSubmit="YY_checkform('form1','firstname','#q','0','Field \'firstname\' is not valid.','sirname','#q','0','Field \'sirname\' is not valid.','email','S','2','Field \'email\' is not valid.','Password','#q','0','Field \'Password\' is not valid.','Password2','#Password','6','Field \'Password2\' is not valid.');return document.MM_returnValue">
<input type="hidden" name="feedback" value=":: Welcome to Busy People Having Fun ::">
<input type="hidden" name="mail-subject" value="<%=subject%>">
<input type="hidden" name="mail-relay" value="<%=relay%>">
<input type="hidden" name="mail-toaddress" value="<%=toAddress%>">
<input type="hidden" name="mail-to" value="<%=toName%>">
<input type="hidden" name="mail-fromAddress" value="<%=fromAddress%>">
<input type="hidden" name="mail-from" value="<%=fromName%>">
<input name="firstname" type="hidden" id="firstname" value="<%=(session1.Fields.Item("firstname"
.Value)%>">
<input name="email" type="hidden" id="email" value="<%=(session1.Fields.Item("email"
.Value)%>">
<table align="center">
<!--DWLayoutTable-->
<tr valign="baseline">
<td width="122" height="16" align="right" nowrap class="BPHF">*Title:</td>
<td class="detailtxt"><%=(session1.Fields.Item("title"
.Value)%> </td>
<td width="15"></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Firstname:</td>
<td class="detailtxt"><%=(session1.Fields.Item("firstname"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Surname:</td>
<td class="detailtxt"><%=(session1.Fields.Item("sirname"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Email:</td>
<td class="detailtxt"><%=(session1.Fields.Item("email"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Company:</td>
<td class="detailtxt"><%=(session1.Fields.Item("company"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Position:</td>
<td class="detailtxt"><%=(session1.Fields.Item("position"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Address:</td>
<td class="detailtxt"><%=(session1.Fields.Item("address1"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Town:</td>
<td class="detailtxt"><%=(session1.Fields.Item("address2"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Region:</td>
<td class="detailtxt"><%=(session1.Fields.Item("address3"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Postcode:</td>
<td class="detailtxt"><%=(session1.Fields.Item("postcode"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Password:</td>
<td class="detailtxt"><%=(session1.Fields.Item("Password"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Repeat Password:</td>
<td class="detailtxt"><%=(session1.Fields.Item("Password"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Telephone:</td>
<td class="detailtxt"><%=(session1.Fields.Item("telephone"
.Value)%> </td>
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Newsletter:</td>
<td class="detailtxt"> <p class="maintxt"><%=(session1.Fields.Item("Newsletter"
.Value)%></p></td>
<td></td>
</tr>
<tr valign="baseline">
<td height="20" valign="top" class="BPHF"><a href="form_response.asp">
<input type="submit" name="Submit" value="Submit">
<br>
Accept</a></td>
<td> <p class="BPHF"><a href="edit.asp"><br>
Edit</a></p></td>
<td></td>
</tr>
</table>
</form>
Respone_form
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
my_from=request("mail-fromName"
my_fromAddress=request("mail-fromaddress"
my_to=request("mail-toName"
my_toAddress=request("mail-toaddress"
my_subject=request("mail-subject"
my_relay=request("mail-relay"
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.RemoteHost = my_relay
Mailer.FromName = my_from
Mailer.FromAddress = my_fromAddress
Mailer.AddRecipient my_to, my_toaddress
Mailer.Subject = my_subject
sBodyText = "Welcome to Busy People Having Fun" & vbcrlf & vbcrlf
sBodyText = sBodyText & "Hello " & request.form("firstname"
& vbCrLf
sBodyText = sBodyText & "Last Name: " & request.form("sirname"
& vbCrLf
sBodyText = sBodyText & "Company: " & request.form("company"
& vbCrLf
sBodyText = sBodyText & "Email Address: " & request.form("email"
& vbCrLf & Chr(13) & Chr(10) & Chr(13) & Chr(10)
sBodyText = sBodyText & "" & request.form("password"
& vbCrLf
sBodyText = sBodyText & "" & request.form("telephone"
& vbCrLf
Mailer.BodyText = sBodyText
If Mailer.SendMail then
Msg = "Thank you for your enquiry.<br> A member of staff will contact you shortly."
Else
Msg = "mail was not sent successfully<br>"
msg = msg & mailer.response & "<br>"
End If
response.write Msg
%>
</body>
</html>
Thanks for the previous suggestions
I am trying to get a form to submit the users email to the FromAddress function.
The form I am using did not have any editable text fields in, it is a details page for users to check details. I could not get these fields to submit to the email so I created hidden text fields with Sessions in.
<input name="firstname" type="hidden" id="firstname" value="<%=(session1.Fields.Item("firstname"
<input name="email" type="hidden" id="email" value="<%=(session1.Fields.Item("email"
This works but I still can’t get the email field to work with this piece of code. The email and firstname are submitted to the body of the text okay.
<%
fromName="Bphf.com"
fromAddress="info@bphf.com"
toName="jeremy"
toAddress=Request.Form("email"
subject="BPHF Membership"
relay="192.168.1.7"
%>
I have tried to put RESPONSE (“email”) as suggested in my previous post. I have also tried taking out – in the names.
The Code
Details.asp
<%
fromName="Bphf.com"
fromAddress="info@bphf.com"
toName="jeremy"
toAddress=Request.Form("email"
subject="BPHF Membership"
relay="192.168.1.7"
%>
-
-
-
<form action="form_response.asp" method="post" name="form1" onSubmit="YY_checkform('form1','firstname','#q','0','Field \'firstname\' is not valid.','sirname','#q','0','Field \'sirname\' is not valid.','email','S','2','Field \'email\' is not valid.','Password','#q','0','Field \'Password\' is not valid.','Password2','#Password','6','Field \'Password2\' is not valid.');return document.MM_returnValue">
<input type="hidden" name="feedback" value=":: Welcome to Busy People Having Fun ::">
<input type="hidden" name="mail-subject" value="<%=subject%>">
<input type="hidden" name="mail-relay" value="<%=relay%>">
<input type="hidden" name="mail-toaddress" value="<%=toAddress%>">
<input type="hidden" name="mail-to" value="<%=toName%>">
<input type="hidden" name="mail-fromAddress" value="<%=fromAddress%>">
<input type="hidden" name="mail-from" value="<%=fromName%>">
<input name="firstname" type="hidden" id="firstname" value="<%=(session1.Fields.Item("firstname"
<input name="email" type="hidden" id="email" value="<%=(session1.Fields.Item("email"
<table align="center">
<!--DWLayoutTable-->
<tr valign="baseline">
<td width="122" height="16" align="right" nowrap class="BPHF">*Title:</td>
<td class="detailtxt"><%=(session1.Fields.Item("title"
<td width="15"></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Firstname:</td>
<td class="detailtxt"><%=(session1.Fields.Item("firstname"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Surname:</td>
<td class="detailtxt"><%=(session1.Fields.Item("sirname"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Email:</td>
<td class="detailtxt"><%=(session1.Fields.Item("email"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Company:</td>
<td class="detailtxt"><%=(session1.Fields.Item("company"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Position:</td>
<td class="detailtxt"><%=(session1.Fields.Item("position"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Address:</td>
<td class="detailtxt"><%=(session1.Fields.Item("address1"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Town:</td>
<td class="detailtxt"><%=(session1.Fields.Item("address2"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Region:</td>
<td class="detailtxt"><%=(session1.Fields.Item("address3"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Postcode:</td>
<td class="detailtxt"><%=(session1.Fields.Item("postcode"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Password:</td>
<td class="detailtxt"><%=(session1.Fields.Item("Password"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF">*Repeat Password:</td>
<td class="detailtxt"><%=(session1.Fields.Item("Password"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Telephone:</td>
<td class="detailtxt"><%=(session1.Fields.Item("telephone"
<td></td>
</tr>
<tr valign="baseline">
<td height="16" align="right" nowrap class="BPHF"> Newsletter:</td>
<td class="detailtxt"> <p class="maintxt"><%=(session1.Fields.Item("Newsletter"
<td></td>
</tr>
<tr valign="baseline">
<td height="20" valign="top" class="BPHF"><a href="form_response.asp">
<input type="submit" name="Submit" value="Submit">
<br>
Accept</a></td>
<td> <p class="BPHF"><a href="edit.asp"><br>
Edit</a></p></td>
<td></td>
</tr>
</table>
</form>
Respone_form
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
my_from=request("mail-fromName"
my_fromAddress=request("mail-fromaddress"
my_to=request("mail-toName"
my_toAddress=request("mail-toaddress"
my_subject=request("mail-subject"
my_relay=request("mail-relay"
Set Mailer = Server.CreateObject("SMTPsvg.Mailer"
Mailer.RemoteHost = my_relay
Mailer.FromName = my_from
Mailer.FromAddress = my_fromAddress
Mailer.AddRecipient my_to, my_toaddress
Mailer.Subject = my_subject
sBodyText = "Welcome to Busy People Having Fun" & vbcrlf & vbcrlf
sBodyText = sBodyText & "Hello " & request.form("firstname"
sBodyText = sBodyText & "Last Name: " & request.form("sirname"
sBodyText = sBodyText & "Company: " & request.form("company"
sBodyText = sBodyText & "Email Address: " & request.form("email"
sBodyText = sBodyText & "" & request.form("password"
sBodyText = sBodyText & "" & request.form("telephone"
Mailer.BodyText = sBodyText
If Mailer.SendMail then
Msg = "Thank you for your enquiry.<br> A member of staff will contact you shortly."
Else
Msg = "mail was not sent successfully<br>"
msg = msg & mailer.response & "<br>"
End If
response.write Msg
%>
</body>
</html>
Thanks for the previous suggestions