Solved

Server side email.

Posted on 2004-09-10
5
231 Views
Last Modified: 2010-04-25
Howdy All, I am in the process of developing a web site with some forms on it.  Is there an easy way to have the server email a form to me when the customer clicks submit?  I DO NOT WANT it emailed from the customer's PC I want my server to email me the data from the form.  My web server is running win2k and IIS and here is the link to the page I want to mail.

http://216.201.187.105/index_contact.html

If custom server side scripts are necessary to accomplish this I would prefer they are vbscript using ASP or ASP.NET.  

Thanks, E
0
Comment
Question by:EWilson12
5 Comments
 
LVL 4

Accepted Solution

by:
Neil_Simpson earned 350 total points
ID: 12031978
0
 
LVL 14

Expert Comment

by:Esopo
ID: 12032128
An extension of Neil's post, this is somewhat of a tutorial for sending the form's information through email using ASP:

http://www.brainjar.com/asp/formmail/

Best regards,

Esopo.
0
 
LVL 2

Assisted Solution

by:izzeddeen
izzeddeen earned 150 total points
ID: 12033648
For your page you can convert your page name to: index_contact.asp and put the following code at the top of the page:

<% if Request.Form <> "" Then
      msgbody = ""                           
      msgbody = msgbody & "this is a feedback email from " & Request("textfield") & vbcrlf
      msgbody = msgbody & "Here is the message:" & Request("textarea") & vbcrlf
            Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
            objCDOMail.From = Request("textfield") & "<" & Request("textfield4") & ">"
            objCDOMail.To = "youremail@yourdomain.com"
            objCDOMail.Subject = "Feedback message"
            objCDOMail.Body = msgbody
            objCDOMail.BodyFormat = 1 ' CdoBodyFormatHTML
            objCDOMail.MailFormat = 0 ' CdoMailFormatMime
            objCDOMail.Importance = 2 '(0=Low, 1=Normal, 2=High)
            objCDOMail.Send
        set objCDOMail = nothing
End if%>

This is a sample code that should work with your listed page, please feel free to ask any further question
0
 
LVL 1

Author Comment

by:EWilson12
ID: 12047188
okay I try izzeddeen's solution and end up with "The page cannot be displayed" and no mail.  Not sure if something needs to be configured on my IIS site or if there is something wrong with the script.  I also tried splitting it up into 2 pages, my code on the 1st page and the script on the second (added the second page to the action of the 1st page's form).

Going to look through the links posted now.

Thanks, E
0
 
LVL 1

Author Comment

by:EWilson12
ID: 12048114
Thanks all, going to split the points between Izze and Neal.  Neal's link gave lead me down the track to finding out my SMTP services were not installed for IIS and will provide the info I need to build on Izze's snippet.  Izze gave me a quick snippet that works (of course the links pointed to pretty much the same snippet but code is always appreciated).

Thanks Again, E
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Center Table on Web Page 6 389
Manipulate Access Database from Web Page 8 518
Saving Form Data when Leaving Page 3 360
slider for the banner 2 313
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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