I looked at the FAQ's and came accross a sample on sending email and posting to DB.
I'm not sure how to make this work... Can some one give me a hand and check what I did?
<html>
<%@ Language=VBScript %>
<%Mname=request.querystring("name")%>
<%Mdate=request.querystring("date")%>
<%Mtime=request.querystring("time")%>
<%Maction=request.querystring("action")%>
<%Mload=request.querystring("load")%>
<%Mnotes=request.querystring("notes")%>
<%
Set Conn = server.CreateObject("ADODB.Connection")
Conn.Open "driver=SQL Server;server=server.com;database=VZThot_DB;"
Set RS1 = Conn.Execute("INSERT INTO dbo.Employee_Tracker (TechID, WRKDate, WRKTime, WRKAction, WRKLOAD, WRKNotes) VALUES ('" & Mname & "', '" & Mdate & "', '" & Mtime & "','" & Maction & "','" & Mload & "','" & Mnotes & "')")
%>
<%
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.ij.net"
Mail.From = "ME@ME.com"
Mail.FromName = "Jesse"
Mail.AddAddress "someone@yoursite.com"
Mail.Subject = "TEST"
msg = "name" & " " & Mname & Chr(13) & Chr(10)
msg = msg & "date" & " " & Mdate & Chr(13) & Chr(10)
msg = msg & "time" & " " & Mtime & Chr(13) & Chr(10)
msg = msg & "action" & " " & Maction & Chr(13) & Chr(10)
msg = msg & "load" & " " & Mload & Chr(13) & Chr(10)
msg = msg & "notes" & " " & Mnotes & Chr(13) & Chr(10)
Mail.Body = msg
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
End If
%>
<head>
<title>Thank you</title>
also, how can I get it to work with cdosys?
I'm not sure how to make this work... Can some one give me a hand and check what I did?
<html>
<%@ Language=VBScript %>
<%Mname=request.querystring("name")%>
<%Mdate=request.querystring("date")%>
<%Mtime=request.querystring("time")%>
<%Maction=request.querystring("action")%>
<%Mload=request.querystring("load")%>
<%Mnotes=request.querystring("notes")%>
<%
Set Conn = server.CreateObject("ADODB.Connection")
Conn.Open "driver=SQL Server;server=server.com;database=VZThot_DB;"
Set RS1 = Conn.Execute("INSERT INTO dbo.Employee_Tracker (TechID, WRKDate, WRKTime, WRKAction, WRKLOAD, WRKNotes) VALUES ('" & Mname & "', '" & Mdate & "', '" & Mtime & "','" & Maction & "','" & Mload & "','" & Mnotes & "')")
%>
<%
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.ij.net"
Mail.From = "ME@ME.com"
Mail.FromName = "Jesse"
Mail.AddAddress "someone@yoursite.com"
Mail.Subject = "TEST"
msg = "name" & " " & Mname & Chr(13) & Chr(10)
msg = msg & "date" & " " & Mdate & Chr(13) & Chr(10)
msg = msg & "time" & " " & Mtime & Chr(13) & Chr(10)
msg = msg & "action" & " " & Maction & Chr(13) & Chr(10)
msg = msg & "load" & " " & Mload & Chr(13) & Chr(10)
msg = msg & "notes" & " " & Mnotes & Chr(13) & Chr(10)
Mail.Body = msg
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encountered: " & Err.Description
End If
%>
<head>
<title>Thank you</title>
also, how can I get it to work with cdosys?