User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Site Layout and Usability section within the Web Development category of DaniWeb, a massive community of 397,775 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,487 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Site Layout and Usability advertiser:
Views: 1965 | Replies: 8
Reply
Join Date: Oct 2006
Location: UK
Posts: 137
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Troubleshooting Jmail with radio buttons and menus

  #1  
Oct 22nd, 2006
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 = "info@themepics.co.uk"
strSMTPServerAddress = "smtp.ntlworld.com"
strCCEmailAddress = "maxmumford@gmail.com" '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
%>
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 137
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: Jmail with radio buttons and menus

  #2  
Oct 23rd, 2006
and i forgot to complete my post lol. Thats the info you wil probably need so can anybody tell me how to add a menu and radio group / button to my jmail script? Thanks,

Max
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Jmail with radio buttons and menus

  #3  
Oct 23rd, 2006
Originally Posted by MaxMumford View Post
and i forgot to complete my post lol. Thats the info you wil probably need so can anybody tell me how to add a menu and radio group / button to my jmail script? Thanks,

Max


I didn't understand what you mean by adding adding menu and radio group to JAMIL script....Do mean that you want to retrieve the option selected and show it in the message that is being sent ??
Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 137
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: Jmail with radio buttons and menus

  #4  
Oct 23rd, 2006
Originally Posted by vishesh View Post
I didn't understand what you mean by adding adding menu and radio group to JAMIL script....Do mean that you want to retrieve the option selected and show it in the message that is being sent ??


yes thats what i need to know. Its for a feedback form were you select which radio button you want. Thanks!!

Max
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Jmail with radio buttons and menus

  #5  
Oct 23rd, 2006
to add a radio buttons in your page.. .. use input tahers an example
[html]

<input type="radio" name="status" value="on"> on
<br>
<input type="radio" name="status" value="off"> off

[/html]
to retrieve it in asp, just that Request.QueryString(name)
Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 137
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: Jmail with radio buttons and menus

  #6  
Oct 24th, 2006
Originally Posted by vishesh View Post
to add a radio buttons in your page.. .. use input tahers an example
[html]

<input type="radio" name="status" value="on"> on
<br>
<input type="radio" name="status" value="off"> off

[/html]
to retrieve it in asp, just that Request.QueryString(name)


im not completely sure how to use that im my jmail script. I am not very experianced in it, i have only been using it for 2 days lol.
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Jmail with radio buttons and menus

  #7  
Oct 24th, 2006
here goes your html code
[html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>
<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="radio" name="status" value="On" />On
<input type="radio" name="status" value="On" />Off
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>

</html>
[/html]
and here's ur script, haven't checked it yet but it must work:
<%
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 = "info@themepics.co.uk"
strSMTPServerAddress = "smtp.ntlworld.com"
strCCEmailAddress = "maxmumford@gmail.com" '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>Status: </b>" & Request.Form("status")
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
%>

hope it works, if doesn't i am here only

vishesh
Last edited by vishesh : Oct 24th, 2006 at 2:23 pm.
Reply With Quote  
Join Date: Oct 2006
Location: India
Posts: 1,289
Reputation: vishesh is on a distinguished road 
Rep Power: 4
Solved Threads: 32
vishesh's Avatar
vishesh vishesh is offline Offline
Nearly a Posting Virtuoso

Re: Jmail with radio buttons and menus

  #8  
Oct 24th, 2006
Sorry forgot explanation...so i have done in html code is that i have put two radio buttons with name status and value On and Off. When you click submit it send the reuest as [html]
survey-code.asp?status=On/Off[/html]
So in the scirpt I retrieve its value by Request.Form("status")
So i hope you got it...

cheers
vishesh
Reply With Quote  
Join Date: Oct 2006
Location: UK
Posts: 137
Reputation: MaxMumford is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Junior Poster

Re: Jmail with radio buttons and menus

  #9  
Oct 25th, 2006
Excellant thanks! im going out now but ill check it out when i get back thanks again. Max
Economizerz Hosting
Price Beater Promise

10% Cheaper Hosting, & Double Bandwidth and Web Space
Click here to apply
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Site Layout and Usability Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Site Layout and Usability Forum

All times are GMT -4. The time now is 4:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC