Solved

Server side email.

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

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

Title # Comments Views Activity
Hide/ show a recordset row item 6 453
Dreamweaver CS6 Sites Setup 2 422
slider for the banner 2 309
Need icon art 9 96
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

912 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

17 Experts available now in Live!

Get 1:1 Help Now