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
Solved

Server side email.

Posted on 2004-09-10
5
232 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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 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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

861 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