Solved

Server side email.

Posted on 2004-09-10
5
225 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
Comment Utility
0
 
LVL 14

Expert Comment

by:Esopo
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

16 Experts available now in Live!

Get 1:1 Help Now