Solved

VB Script Question

Posted on 2003-12-08
10
245 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now