Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Server side email.

Posted on 2004-09-10
5
Medium Priority
?
239 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 1400 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 600 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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 …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

886 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