Cant figure out senton and response

This is a discussion on "Cant figure out senton and response" within the ASP.NET Forum section. This forum, and the thread "Cant figure out senton and response are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 15th, 2007, 10:01
New Member
Join Date: Jun 2007
Location: Sweden
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Cant figure out senton and response

Hi!

I have a little problem you probably can help me with. I have created a contact form (by borrowing some code from a MS example and altering it) which sends mail to an address of my choice. It's working, but I want to add some more functions...

Since I'm totally new to ASP (or APS.Net) I've run into something I can't figure out.

1) Where do I put the Response.Redirect line to make it work?
I simply want the form filler to be directed to another page...

2) I've read about a senton command, which I think can be used to include a time and date on the mail, but how?


My code is included below.

Kind regards,
Foobster

Code: Select all
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<%@ CodePage=65001 Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
' send by connecting to port 25 of the SMTP server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost
Const cdoSendUsingPort = 2
StrSmartHost = "smtpserver"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 10
.Update
End With
' build HTML for message body
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "Meddelandet kommer från  " & Request.Form("namn") & "<br></br><br></br>"_
& "E-mail: " & Request.Form("email") & "<br></br><br></br>"_
& "Telefon: " & Request.Form("telefon") &"<br></br><br></br>"_
& "Vill ha mer information om " & Request.Form("angaende") & "<br></br><br></br>"_
& "Meddelande: " & "<br></br>" & Request.Form("meddelande") 
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
 
' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = anyone@nowhere.com
.From = someone@anywhere.com 
.Subject = Request.Form("namn") & " vill ha information om " & Request.Form("angaende")
.HTMLBody = strHTML
.Send
End With
Response.Redirect("tack.asp")
' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
%>
</BODY>
</HTML>
Reply With Quote

Reply

Tags
response, senton

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to figure out about keeping chat in... mcdanielnc89 Web Page Design 4 Sep 13th, 2007 17:31
Rendering Problems in IE (go figure) Zonglars JavaScript Forum 2 Jul 22nd, 2007 10:46
Simple problem that i cant figure out!! robukni Flash & Multimedia Forum 2 Apr 26th, 2007 23:25
Cant figure out the query roleary Databases 3 Apr 26th, 2006 21:02


All times are GMT. The time now is 00:18.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43