Forums

ASP

This topic is locked

Help convert cdonts to jmail

Posted 26 May 2008 16:03:43
1
has voted
26 May 2008 16:03:43 Johan Palm posted:
Hello My ISP do not support Jmail and I don't now how to make this script work with jmail.

Is there anyone that can help me?

config file.
========================================================================================

'This first line is the path to the database. (Server.Mappath makes the path relative to the location of the config.asp file, but I recommend moving the database to an offline folder for security reasons)
dsn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &Server.Mappath("login.mdb"

'SiteName is what appears in the title of all Login Pages (it can be anything you like)
'WARNING: Do not use non-alpha-numeric characters for this setting because starting with version 3.5, this is also the name of the cookie generated by the user checking the "keep me logged in" box on the login page
sitename="anything.se"

'HeadImg is the location of the picture you wish to use as your header (it will also appear at the top of each page - the default is the RandomRavings Logo)
headimg="/images/head_small_2.gif"

'MembersOnly is the page that members are redirected to once they log in. (it should be a protected page)
membersonly="memtest.asp"

'This is the page that the admin is redirected to once they log in (this can be the same as members only if you like)
adminpage = "admin.asp"

'This is the level that the admins have
adminLevel=3

'Whether or not to send a confirmation e-mail to their address before letting them log in
sendConfirmation = false

''Whether or not to send a welcome e-mail to their address after registering (NOTE: If sendConfirmation is true, then a confirmation e-mail is sent instead of a welcome e-mail)
sendWelcome = false

'Whether or not to send password reminders to the user's e-mail address (if false the password will be displayed in plain text on the "forgot passowrd" page which is NOT VERY SECURE because anyone who knows the user's e-mail address can see their password)
sendPassword = false

'The address that forgotton passwords and confirmation e-mails are sent from (the address does not have to exist <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
str_from = " "

'This is your site's URL (don't forget the trailing slash)
siteurl = "www.anything.se/"

'This is the full path to login on your server (don't forget the trailing slash)
loginurl = "www.anything.se/"


%&gt;

=========================================================================================
CDONTS mail file
=========================================================================================



%&gt;
&lt;!--#INCLUDE file="config.asp"--&gt;
&lt;%
strMode = request.querystring("mode"
str_to = request.querystring("str_to"

SQL="SELECT * FROM users where EMail ='" & str_to & "'"

Set conn=Server.CreateObject("ADODB.Connection"
Set RS = Server.CreateObject("ADODB.Recordset"

conn.Open dsn
rs.open sql, conn

if strMode = "password" then
if rs.EOF then
CloseDB()
Response.Redirect("forgot_password.asp?stat=bademl"
end if

str_subj = sitename & " Password Reminder"

str_body = "Automated Password Reminder From " &sitename & vbCrLf
str_body = str_body & "--------------------------------" & vbCrLf
str_body = str_body & "UserName: " & RS("UserName" & vbCrLf
str_body = str_body & "Password: " & RS("strPassword" & vbCrLf
elseif strMode = "welcome" then
str_subj = "Welcome to "& sitename

str_body = "Welcome to " &sitename & vbCrLf
str_body = str_body & "--------------------------------" & vbCrLf
str_body = str_body & "UserName: " & RS("UserName" & vbCrLf
str_body = str_body & "Password: " & RS("strPassword" & vbCrLf
else
str_subj = sitename & " E-Mail Validation"
str_body = "Please visit the following URL to validate your "&sitename&" membership. ("&loginurl&"validate.asp?n="&rs("confirmation_num"&""
end if

CloseDB()

Set mail = CreateObject("CDONTS.NewMail"
mail.From = str_from
mail.To = str_to
mail.Subject = str_subj
mail.Body = str_body

if strMode="password" then
if sendPassword = true then
mail.Send
set mail=nothing
Response.Redirect("login.asp?stat=checkeml"
else
Response.Write(str_body)
end if
else
mail.Send
set mail=nothing
Response.Redirect("login.asp?stat=checkeml"
end if

sub CloseDB()
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
end sub
%&gt;

=========================================================================================

All help is needed.

Reply to this topic