Jump to content

code register and sendmail. Have a problem!


haibec
 Share

Recommended Posts

This is my code:<!--#include file="Connection.asp" --><%full_name = getString(Request.Form("full_name"),70)question = getString(Request.Form("question"),70)answer = getString(Request.Form("answer"),70)email = getString(Request.Form("email"), 70)gender = getString(Request.Form("gender"),1)sday = CInt(Request.Form("day"))smonth = CInt(Request.Form("month"))syear = CInt(Request.Form("year"))state = getString(Request.Form("state"), 70)district = getString(Request.Form("district"),70)address = getString(Request.Form("address"),100)telephone = getString(Request.Form("telephone"),15)strSql = "_AddUser '" & full_name & "', '"strSql = strSql & question& "', N'"strSql = strSql & answer & "', N'"strSql = strSql & email & "', '"strSql = strSql & gender & "', '"strSql = strSql & birth & "', N'"strSql = strSql & state & "', N'"strSql = strSql & district & "', N'"strSql = strSql & address & "', '"strSql = strSql & telephone & "'Conn.Execute (strSQL)Call CloseDB()%><table valign="middle" align="center" width="100%"><tbody><tr><td><fieldset><legend><strong> <font color="#FFFFFF">Notice board</font></strong></legend> <table style="color: rgb(0, 0, 0);" border="0" cellpadding="5" cellspacing="0" width="100%"> <tbody> <tr> <td class="style2" align="center"> <br><br><p align="center" valign=middle><h3 align="center"><font color="#FFFFFF"><br>Register Success</font></h3></p><br><br><br><br><br><br><br><br><br><br> </td> </tr> </tbody></table></fieldset></td></tr></tbody></table>I want affter this user register success . Program auto send a mail to exact this user. Please help me. (_Adduser is a Procedure in my MS SQL to replace " insert into.......")

Link to comment
Share on other sites

This will send an email to the registered user, add this code after the Conn.Execute (strSQL)Call CloseDB()<%Dim objCDOMail      'Holds the CDONTS NewMail Object'Create the e-mail server objectSet objCDOMail = Server.CreateObject("CDONTS.NewMail")'Who the e-mail is fromobjCDOMail.From = "myE-mailHere@myDomain.com"'Who the e-mail is sent to This is where you will give the user's emailobjCDOMail.To = email 'Set the subject of the e-mail objCDOMail.Subject = "Enquiry sent from my web site"'Set the e-mail body format (0=HTML 1=Text)objCDOMail.BodyFormat = 0'Set the mail format (0=MIME 1=Text)objCDOMail.MailFormat = 0'Set the main body of the e-mailobjCDOMail.Body = "<h2>Hello</h2><br><b>This is my e-mail in HTML format</b>"'Importance of the e-mail (0=Low, 1=Normal, 2=High)objCDOMail.Importance = 1'Send the e-mailobjCDOMail.Send'Close the server objectSet objCDOMail = Nothing%>

Link to comment
Share on other sites

This will send an email to the registered user, add this code after the Conn.Execute (strSQL)Call CloseDB()<%Dim objCDOMail      'Holds the CDONTS NewMail Object'Create the e-mail server objectSet objCDOMail = Server.CreateObject("CDONTS.NewMail")'Who the e-mail is fromobjCDOMail.From = "myE-mailHere@myDomain.com"'Who the e-mail is sent to This is where you will give the user's emailobjCDOMail.To = email 'Set the subject of the e-mail objCDOMail.Subject = "Enquiry sent from my web site"'Set the e-mail body format (0=HTML 1=Text)objCDOMail.BodyFormat = 0'Set the mail format (0=MIME 1=Text)objCDOMail.MailFormat = 0'Set the main body of the e-mailobjCDOMail.Body = "<h2>Hello</h2><br><b>This is my e-mail in HTML format</b>"'Importance of the e-mail (0=Low, 1=Normal, 2=High)objCDOMail.Importance = 1'Send the e-mailobjCDOMail.Send'Close the server objectSet objCDOMail = Nothing%>

Okie thank you! But have error :Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed SubmitForm.asp, line 76 800401f3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...