Hi, I inherited code that needs to work with my local SBS 2008 Exchange 2007 server. This is the original code:
<!--#include virtual="/Include/incGUID.asp"-->
<%
strFirst = Request("First")
strLast = Request("Last")
strCompany = Request("Company")
strPhone = Request("Phone")
strCity = Request("City")
strState = Request("State")
strEmail = Request("Email")
strPassword = Request("Password")
strNow = Year(Date()) & "-" & Month(Date()) & "-" & Day(Date()) & " " & Hour(Now()) & ":" & Minute(Now()) & ":" & Second(Now())
strRecordKey = createGuid()
Set rs = CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO tblpassloads (GUID, NameFirst, NameLast, Email, Company, City, State, Phone, Password, LastVisit, Approved, Entered, InBy) VALUES ('" & strRecordKey & "', '" & strFirst & "', '" & strLast
& "', '" & strEmail & "', '" & strCompany & "', '" & strCity & "', '" & strState & "', '" & strPhone & "', '" & strPassword & "', '" &
strNow & "', '0', '" & strNow & "', 'WebForm')"
rs.Open strSQL, Application("dbcConn")
Set rs = Nothing
'Send an html email with the VQ server
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
strHTML = "<html><head><title>Load List Request</title></head><body>There is a new request for load list access approval. You can view this request at <a href=""F*******r">http://www.f*******r.com/adminlogin"">F*******r A****</a>.</body></html>"
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Load List new password request"
objMessage.From = """F** *****r"" <j***@f*******r.com>"
objMessage.To = "j***@f*******r.com"
'objMessage.To = "m******n@g***l.com"
objMessage.HTMLBody = strHTML
'objMessage.CreateMHTMLBody "file://C:/Documents and Settings/k****i.F*******R/My Documents/LoadListStuff/LoadList.html"
'==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "MailHostNameURL"
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "j***@f*******r.com"
'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "a***@**3"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 20
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
Response.Redirect "SignUpAckn.asp"
%>
This code on a hosted web server asp page does not work. I don't know what email server was used before and it is gone anyway. Now I have an in-house SBS2008 / Exchange 2007 server which I would like to use to send this message from the hosted webpage. Do I need to consider using a different server? And how do I make this code