Solved

VB Script Question

Posted on 2003-12-08
10
246 Views
Last Modified: 2010-04-06
I have a webpage that has a form on it with a few fields in the form.  I want to be able to click on a button and have the information in the form emailed to a certain email address.

So I would like to know how to do this using VB Script if it's possible.

Thanks.
0
Comment
Question by:ecohouse
  • 5
  • 3
  • 2
10 Comments
 
LVL 1

Expert Comment

by:Jagata
ID: 9901437
Check out DundasMailer which is a free component to do this;

   http://www.dundas.com/other/dundasmailer/index.aspx?Section=DundasMailer&Body=body.htm

And also check out w3 JMail Free which we use at work;

   http://www.dimac.net/
0
 

Author Comment

by:ecohouse
ID: 9905520
Thanks for the information.  But isn't there a simple way to just code this using either VB Script or ASP instead of having to get a component?
0
 
LVL 35

Expert Comment

by:YZlat
ID: 9906056
add action="mailto:yourname@domain.com" to a <form> tag:

<form name="myForm" method="post" action="mailto:yourname@domain.com">
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 35

Expert Comment

by:YZlat
ID: 9906065
let me know if that's what you looking for
0
 

Author Comment

by:ecohouse
ID: 9907853
Thanks for the help.  I'm new to webpages.  Where do I be put the code you gave me on the form?  Do I need to create a function?

And how does it take all of the information from the form?
0
 
LVL 1

Accepted Solution

by:
Jagata earned 250 total points
ID: 9908110
I would highly suggest getting a component. Specifically I would go with w3 JMail. Here is an example of implementation;

      Set JMail = Server.CreateObject("JMail.SMTPMail")
      JMail.Silent = False
      JMail.Logging = True
      JMail.ServerAddress = "192.168.1.248"
      JMail.Sender = pstrEmailAddress 'Variable containing sender email address.
      JMail.AddRecipient "email@email.com" 'Your email address.
      JMail.Subject = pstrSubject 'Variable containing subject for email.
      JMail.ContentType = "text/html"
      JMail.Body = pstrBody 'Variable containing content of email.
      JMail.Execute

With all respect to YZlat, the other approach is not the best method.

"This method does not work with every browser, but does work with Microsoft Internet Explorer, Mozilla/Netscape, and the old Netscape 4.x browsers, which are used by 95% or more of users at the time of this writing. The biggest disadvantage: as of this writing, Microsoft Internet Explorer will display a warning to the user, pointing out that submitting a form by email will disclose their email address to the recipient, and asking if they really want to do that." - boutell.com
0
 
LVL 35

Expert Comment

by:YZlat
ID: 9910208
<html>
<body>

<form name="myForm" method="post" action="mailto:yourname@domain.com">


'***YOUR FORM FIELDS GO HERE



</form>
</body>
</html>
0
 
LVL 35

Expert Comment

by:YZlat
ID: 9910212
Jagata, when you simply want to e-mail the forn's results that method works just fine. It seems like ecohouse does not want to composen an e-mail but simply e-mail the results of the form
0
 
LVL 35

Expert Comment

by:YZlat
ID: 9910219
besides, ecohouse is using html and vbscript, not asp.
0
 
LVL 1

Expert Comment

by:Jagata
ID: 9910248
YZlat, If you want to discuss the flaws of submitting a form via email, open a question with some points for me, otherwise I couldn't care less.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question