Need help...
I 'inherited' a website with an .asp driven login page. When a password is entered, the asp script checks the login.mdb file for an e-mail match and, if one is found, it generates an e-mail and sends to the address it matched. An incorrect e-mail entry generates the "We're sorry..." response.
I'm being told that the ObjMail component we've used for many years is no longer supported by our host and that I need to now use the asp mail component. I didn't write this particular piece of ObjMail code so am at a loss as to how to make the conversion.to the .asp mail component
Any help offered would be most appreciated
The ObjMail file from the current system...
-----------------------------------------------------------------------------------
<%Response.Buffer=TRUE%>
<%
'Here is the connection string
Set conn = server.createobject("adodb.connection")
'This connection uses JET 4. It is the preferred method of connecting to an access database
DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("../login.mdb")
'If you cant use JET then comment out the line above and uncomment the line below
'DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("../login.mdb")
conn.Open DSNtemp
'Get information from the lost password form
uid = Request.Form("T1")
SQL = "Select * From users Where uid = '" & uid & "'"
Set RS = Conn.Execute(SQL)
'Check to make sure that the users email exists. If it does, email it to the user
If NOT RS.EOF Then
Dim mytxt
mytxt = "Here is your password: "
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
'If the email address exists then the info is sent here
ObjMail.To = RS("uid")
'The email address below will appear in the from line of the message that is sent to the user
ObjMail.From = "Scoutmaster@aol.com"
ObjMail.Subject = "Lost Password"
'Send the user the lost password
ObjMail.Body = mytxt & vbcrlf&_
RS("pwd")
ObjMail.Send
Set ObjMail = Nothing
x = "Thank you. Your password will be sent to the e-mail address you entered."
Else
'If the entered email addrees does not exist in the database tell the user
x = "We're sorry. The e-mail address you entered is not in our database. Please return to the Home Page and contact the Assistant Scoutmaster for help."
End If
%>
<html>
<head>
<title>Lost Password</title>
<link rel="stylesheet" type="text/css" href="../../troop_683.css">
</head>
<body>
<center><%=x%></center>
</body>
</html>
The .asp mail component provided by 1&1 Hosting
-----------------------------------------------------------------------------------
<% @LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Set Mail = Server.CreateObject("SMTPsvg.Mailer") 'create an Asp mail component.
Mail.FromName = "1&1 Test"
Mail.FromAddress= Request.Form("email")
Mail.RemoteHost = "mrelay.perfora.net" ' The mail server you have to use with Asp Mail
Mail.AddRecipient "ABCDE Company", "hello@justonedomain.com"
Mail.Subject = "Website - Info Request"
Mail.BodyText = Request.Form("info")
if Mail.SendMail then
Response.Write "Your mail has already been sent..."
else
Response.Write "Mail send failure. Error was " & Mail.Response
end if
%>
<body>
<p>Thank You!!<br>
</body>
</html>