Set adoCon = CreateObject("ADODB.Connection")with adoCon.connectionTimeout = 2000.open "Provider=providername;Server=servername;Database=DBname;UID=userid;PWD=password;"end withSet recset = CreateObject("ADODB.Recordset")strSQL = "SELECT * FROM CUSTOMERS WHERE REGDATE<'" & DateAdd("d",-4,Date())&"'" recset.open strSQL, adocon, 1int n=0dim ROLE()dim NAME()dim countcount=0if recset.RecordCount>0 thenReDim ROLE(CInt(recset.RecordCount))ReDim NAME(CInt(recset.RecordCount))while not recset.EOFNAME(count)=recset("NAME")ROLE(count)=recset("ROLE")count=count+1recset.MoveNextwendend ifstrEmail = "NAME ROLE"&vbCrfor i=0 to count-1strEmail = strEmail &" "&NAME(i)&" "&ROLE(i)&vbCrnextSet Mailer = CreateObject("SMTPsvg.Mailer")Mailer.FromName = "administrator/UR name "Mailer.FromAddress = "Mail-ID"Mailer.RemoteHost = "localhost"Mailer.AddRecipient "abc@gmail.com" Mailer.Subject = "5days back registerd persons details"Mailer.BodyText = strEmailMailer.ContentType = "text/html"Mailer.SendMail Set Mailer = nothing'CloseConnectionson error resume nextrecset.close set recset = nothingadoCon.close set adoCon = nothing