Hi all,
I want to make a jmail sendmail script for a form with radio buttons and menus. Below is an example form:
<form name="form1" method="post" action="survey-code.asp">
<p>
<input name="email" type="text" id="email">
</p>
<p>
<select name="list1" id="list1">
<option>a</option>
<option>b</option>
<option>c</option>
</select>
</p>
<p>
<select name="list2" id="list2">
<option>a</option>
<option>b</option>
<option>c</option>
</select>
</p>
<p>
<select name="list3" id="list3">
<option>a</option>
<option>b</option>
<option>c</option>
</select>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
below is the jmail script i am using for a more simple form:
<%
Response.Buffer = True
Dim strBody 'Holds the body of the e-mail
Dim objJMail 'Holds the mail server object
Dim strMyEmailAddress 'Holds your e-mail address
Dim strSMTPServerAddress 'Holds the SMTP Server address
Dim strCCEmailAddress 'Holds any carbon copy e-mail addresses if you want to send carbon copies of the e-mail
Dim strBCCEmailAddress 'Holds any blind copy e-mail addresses if you wish to send blind copies of the e-mail
Dim strReturnEmailAddress 'Holds the return e-mail address of the user
strMyEmailAddress = "[EMAIL="info@example.com"]info@example.com[/EMAIL]"
strSMTPServerAddress = "smtp.example.com"
strCCEmailAddress = "[EMAIL="infocc@example.com"]infocc@example.com[/EMAIL]" 'Use this string only if you want to send the carbon copies of the e-mail
strBCCEmailAddress = ""
strReturnEmailAddress = Request.Form("email")
strBody = "<h2>E-mail sent from form on Web Site</h2>"
strBody = strBody & "<br><b>Name: </b>" & Request.Form("Name")
strBody = strBody & "<br><b>E-mail: </b>" & strReturnEmailAddress
strBody = strBody & "<br><b>Question: </b>" & request.form("question")
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then
strReturnEmailAddress = strMyEmailAddress
End If
Set objJMail = Server.CreateObject("JMail.SMTPMail")
objJMail.ServerAddress = strSMTPServerAddress
objJMail.Sender = strReturnEmailAddress
objJMail.SenderName = Request.Form("Name")
objJMail.AddRecipient strMyEmailAddress
objJMail.AddRecipientCC strCCEmailAddress
objJMail.AddRecipientBCC strBCCEmailAddress
objJMail.Subject = "Enquiry sent from enquiry form on website"
objJMail.HTMLBody = strBody
'objJMail.Body = strBody
objJMail.Priority = 3
objJMail.Execute
Set objJMail = Nothing
%>