Print Page | Close Window

Email notification when a new member ....

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2039
Printed Date: 29 March 2026 at 5:16am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Email notification when a new member ....
Posted By: peter pan
Subject: Email notification when a new member ....
Date Posted: 24 April 2003 at 1:56am

Hi Anyone!

I like to do this.When a new member submitting on my site i want a email notification.What is the code,and how do i step by step please.




Replies:
Posted By: ilikeit
Date Posted: 24 April 2003 at 2:23am

It`s very EZ to do, I think followed information will help you to do that! Good Luck!

 sub Jmail(email,topic,mailbody)
 on error resume next
 dim JMail
 Set JMail=Server.CreateObject("JMail.SMTPMail")
 JMail.Logging=True
 JMail.Charset="iso-8859-1"
 JMail.ContentType = "text/html"
 JMail.ServerAddress=Forum_info(4)
 JMail.Sender=Forum_info(5)
 JMail.Subject=topic
 JMail.Body=mailbody
 JMail.AddRecipient email
 JMail.Priority=1
 'JMail.MailServerUserName = mailto:look@me.com - look@me.com  'Mail Server username
 'JMail.MailServerPassword = "hello" 'Password
 JMail.Execute
 Set JMail=nothing
 if err then
 SendMail=err.description
 err.clear
 else
 SendMail="OK"
 end if
 end sub

 sub Cdonts(email,topic,mailbody)
 on error resume next
 dim  objCDOMail
 Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
 objCDOMail.From =Forum_info(5)
 objCDOMail.To =email
 objCDOMail.Subject =topic
 objCDOMail.BodyFormat = 0
 objCDOMail.MailFormat = 0
 objCDOMail.Body =mailbody
 objCDOMail.Send
 Set objCDOMail = Nothing
 if err then
 SendMail=err.description
 err.clear
 else
 SendMail="OK"
 end if
 end sub

 sub aspemail(email,topic,mailbody)
 on error resume next
 dim mailer,recipient,sender,subject,message
 dim mailserver,result
 Set mailer=Server.CreateObject("ASPMAIL.ASPMailCtrl.1") 
 recipient=email
 sender=Forum_info(5)
 subject=topic
 message=mailbody
 mailserver=Forum_info(4)
 result=mailer.SendMail(mailserver, recipient, sender, subject, message)
 if err then
 SendMail=err.description
 err.clear
 else
 SendMail="OK"
 end if
 end sub

 sub Emailbody(body)
 Emailbody=Emailbody &"<style>A:visited { TEXT-DECORATION: none }"
 Emailbody=Emailbody &"A:active  { TEXT-DECORATION: none }"
 Emailbody=Emailbody &"A:hover   { TEXT-DECORATION: underline overline }"
 Emailbody=Emailbody &"A:link    { text-decoration: none;}"
 Emailbody=Emailbody &"A:visited { text-decoration: none;}"
 Emailbody=Emailbody &"A:active  { TEXT-DECORATION: none;}"
 Emailbody=Emailbody &"A:hover   { TEXT-DECORATION: underline overline}"
 Emailbody=Emailbody &"</style>"
 Emailbody=Emailbody &"<TABLE border=0 width='95%' align=center><TBODY><TR>"
 Emailbody=Emailbody &"<TD valign=middle align=top>"
 Emailbody=Emailbody & body
 Emailbody=Emailbody &"</TD></TR></TBODY></TABLE><br><hr width=95% size=1>"
 Emailbody=Emailbody & " &nbsp;&nbsp; "
 Emailbody=mailbody
 end sub



Posted By: peter pan
Date Posted: 24 April 2003 at 3:18pm

Hi!

What to do and how whit the script?Step by step please.

Can you help me?Here is my register.asp script.

 

<%
dim xxxxm, rsheadUpdatee, rsheadUpdatee_numRows
Dim textfield, textfield3, textfield4, textfield5, textfield6, textfield7, textfield8, textfield9, textfield10, textfield11, checkbox, SAVECOOKIES, rsup, rsup_numRows, textfield2, ipaddy, thequery, p_id, rsdup, rsdup_numRows, MM_editAction

Function sqlsafe(s)
pos = InStr(s, "'")
      While pos > 0
           s = Mid(s, 1, pos) & "'" & Mid(s, pos + 1)
           pos = InStr(pos + 2, s, "'")
      Wend
sqlsafe=s
End Function

if request.form("MM_insert") = "true" then

textfield = request.form("textfield")

set rsdup = Server.CreateObject("ADODB.Recordset")
rsdup.ActiveConnection = MM_conn_STRING
rsdup.Source = "SELECT p_user FROM p_users WHERE p_user = '" + Replace(textfield, "'", "''") + "'"
rsdup.CursorType = 0
rsdup.CursorLocation = 2
rsdup.LockType = 3
rsdup.Open()
rsdup_numRows = 0


if NOT request.form("textfield2") = request.form("textfield12") then
message = 53
rsdup.close
set rsdup = nothing

elseif ucase(request("textfield")) = ucase("Administration") Then 
message = 54
rsdup.close
set rsdup = nothing

elseif ucase(request("textfield")) = ucase("Admin")  Then
message = 54
rsdup.close
set rsdup = nothing

elseif NOT rsdup.EOF And NOT rsdup.BOF then
message = 52
rsdup.close
set rsdup = nothing

elseif request.form("textfield2") = request.form("textfield12") AND rsdup.EOF And rsdup.BOF AND NOT ucase(request("textfield")) = ucase("Administration") AND NOT ucase(request("textfield")) = ucase("Admin")  Then

  textfield2 = request.form("textfield2")
  textfield3 = request.form("textfield3")
  textfield4 = request.form("textfield4")
  textfield5 = request.form("textfield5")
  textfield6 = request.form("textfield6")
  textfield7 = request.form("textfield7")
  textfield8 = request.form("textfield8")
  textfield9 = request.form("textfield9")
  textfield10 = request.form("textfield10")
  textfield11 = request.form("textfield11")
  checkbox = request.form("checkbox")
                ipaddy = Request.ServerVariables("REMOTE_ADDR")

If rsdup.EOF And rsdup.BOF Then

if request.form("SAVECOOKIES") = "yes" then
Response.Buffer = True

' This script handles both the adding and deleting of cookies
Dim strCookieName  ' id
Dim strCookiePass  ' pass
Dim strCookieValue ' The value to be assigned to it
Dim strCookieValue2 ' The value to be assigned to it

' Get the values passed in by the other script
strCookieName  = "id"
strCookiePass  = "access"
strCookieValue = request.form("textfield")
strCookieValue2 = request.form("textfield2")

' If no name is passed in then we don't do anything
If strCookieName <> "" AND strCookiePass <> "" Then

 If strCookieValue <> "" AND strCookieValue2 <> ""Then
  Response.Cookies(strCookiePass) = strCookieValue2
  Response.Cookies(strCookiePass).Expires = Date() + 365

  Response.Cookies(strCookieName) = strCookieValue
  Response.Cookies(strCookieName).Expires = Date() + 365

 End If
End If

ElseIf request.form("SAVECOOKIES") <> "yes" then
  Response.Cookies("id") = "$"
  Response.Cookies("id").Expires = Date() + 1

  Response.Cookies("access") = "$"
  Response.Cookies("access").Expires = Date() + 1
end if
Session.Abandon

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open MM_conn_STRING
sql1 = "insert into p_users (p_user,p_password,p_state,p_first,p_last,p_email,p_phone,p_fax,p_address,p_city,p_zip,p_newsletter,p_ip) values('"& sqlsafe(textfield) & "','"& sqlsafe(textfield2) & "','"& textfield3 & "','"& sqlsafe(textfield4) & "','"& sqlsafe(textfield5) & "','"& sqlsafe(textfield6) & "','"& sqlsafe(textfield7) & "','"& sqlsafe(textfield8) & "','"& sqlsafe(textfield9) & "','"& sqlsafe(textfield10) & "','"& sqlsafe(textfield11) & "','"& checkbox & "','"& sqlsafe(ipaddy) & "')"
conn.execute(sql1)

SQL1 = "SELECT p_id FROM p_users WHERE p_user =  '" + Replace(textfield, "'", "''") + "'"
Set rsReg = conn.execute(sql1)
p_id = rsReg("p_id")

   Dim objCDO
   Set objCDO = Server.CreateObject("CDONTS.NewMail")
      body = "Hej " & textfield4  & (" ") & textfield5  & vbCrLf & vbCrLf
      body = body & "Din användarnamn är: " & textfield  & vbCrLf
      body = body & "Ditt lösenord är: " & textfield2  & vbCrLf & vbCrLf
      body = body & "Din aktivation nummer är: " & p_id  & vbCrLf & vbCrLf
      body = body & "Du har 24 timmar på dig att aktivera ditt konto annars din registration tas bort. Använd länken för ditt konto aktivering. " & vbCrLf & vbCrLf
      body = body & weburl & "activate.asp?activate=" & p_id & vbCrLf
 
   objCDO.To = textfield6
   objCDO.From = websitename & " < " & webemail & (" >")
   objCDO.Subject = "Aktivera ditt konto!"
   objCDO.Body = body
   objCDO.Send()
                        Set objCDO = Nothing
rsdup.close
set rsdup = nothing
conn.close
set conn = nothing
MM_conn_STRING.close
set MM_conn_STRING = nothing
set SQL = nothing
set rsReg = nothing

                SAVECOOKIES = request.form("SAVECOOKIES")
                        response.redirect("activate.asp?message=14&f=" & textfield4 & ("&l=") & textfield5 & ("&e=") & textfield6 & ("&c=") & SAVECOOKIES)
    end if
  end if

end if
%>

 

 

 

<!--#include file="header.asp"-->
<script  language="JavaScript">
<!-- Hide from older browsers...

//Function to check that the form is filled in correctly
function CheckForm () {

 //Check User id
 if (document.form1.textfield.value == ""){
  alert("Ange medlemsid");
  document.form1.textfield.focus();
  return false;
 }
 
 //Check pass
 if (document.form1.textfield2.value == ""){
  alert("Ange ditt lösenord");
  document.form1.textfield2.focus();
  return false;
 }
 
 //Check pass
 if (document.form1.textfield12.value == ""){
  alert("Bekräfta ditt lösenord");
  document.form1.textfield12.focus();
  return false;
 }
 
&n




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net