?
Solved

VB Script Question

Posted on 2003-12-08
10
Medium Priority
?
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Suggested Courses

764 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