Jump to content

send mail


idsanjeev

Recommended Posts

<% Server.ScriptTimeout = 360 %><%session.LCID=3081%><body bgcolor=linen leftmargin=0 rightmargin=0 topmargin=0 ><table cellSpacing="0" cellPadding="0" bordercolor="#99CC00" width="100%" border="1" bgcolor="#E1FBDD"><tr>	<td>		<TABLE background="line1.gif" width=100% border="0" cellpadding="2" cellspacing="1"><%dim late,early,time1,time2'formatdatetime(time()4)Set con = Server.CreateObject("ADODB.Connection")con.open "Provider=MSDAORA.1;Password=acs00;User ID=acs;Data Source=intradb;Persist Security Info=True"Set con2 = Server.CreateObject("ADODB.Connection")con2.open "Provider=MSDAORA.1;Password=smf;User ID=fms;Data Source=isap;Persist Security Info=True"set R=CON.Execute("SELECT empno FROM M_VAR_EMPLOYEE @ALF2 WHERE dept_cd='"&Session("sect")&"' AND CAT_SUB=2 AND STATUS=1 AND YR_MON=(SELECT MAX(YR_MON)FROM M_VAR_EMPLOYEE@ALF2) AND ( DEPT_CD IN(SELECT SECTCODE FROM DTL_DEPT WHERE CAT_SUB=2 AND SHIFT_YN='N'))")if r.eof =true then%><center><table><tr><td><font face="arial" size="+3" color="#CC0000"><%=("No records")%></font></td></tr></table></center><%elsewhile not R.eof vempno=R("empno")Set RS3=CON.Execute("SELECT a.empno,a.seqno,TO_CHAR(a.opdate,'DD-Mon-yyyy')opdate,b.dscr,a.optime,a.ioflg,a.pnch_flg FROM acs_data a,m_card b WHERE a.cardno=b.readerno AND empno='"&vempno&"' AND opdate>=(to_date('"&Session("date1")&"','dd/mm/yyyy')) AND opdate<=(to_date('"&Session("date2")&"','dd/mm/yyyy')) and TO_DATE(optime,'HH24:MI') > = TO_DATE('"&session("lateby")&"','HH24:MI') AND LTRIM(RTRIM(TO_CHAR(opdate,'day'))) NOT LIKE 'saturday' and LTRIM(RTRIM(TO_CHAR(opdate,'day'))) NOT LIKE 'sunday' AND (seqno=(SELECT MIN(seqno) FROM acs_data WHERE empno=a.empno AND opdate=a.opdate)) AND opdate  NOT IN (SELECT hdate  FROM HOLIDAY WHERE  hdate>='"&Session("date1")&"' AND hdate<='"&Session("date2")&"' )") 'if rs3.eof=true then'response.Redirect("massage.asp")'else				while not rs3.eof		empno = rs3("empno")		reader_in = rs3("dscr")		intime =  Rs3("optime")		opdate=Rs3("opdate")	   set RS4= CON.EXECUTE("SELECT  a.EMPNO,a.seqno,TO_CHAR(a.OPDATE,'DD-Mon-YYYY') OPDATE , b.dscr,a.optime,a.ioflg,a.PNCH_FLG FROM acs_data a,m_card b WHERE a.cardno=b.READERNO AND  empno='"&empno&"' AND opdate='"&OPDATE&"' AND (seqno=(SELECT MAX(seqno)FROM acs_data WHERE empno='"&empno&"' AND opdate='"&OPDATE&"'))")		%> 		<%I = I+1%>		<%I = I+1%>		<%	Set RS_NAME=CON2.Execute("select NAME,desig_id from M_FIX_EMPLOYEE where empno like '"&empno&"'")	%>	<TR height="1">	<td height="1" bgcolor="#FF9900"></td>	<TD  colspan=9 height="1" BGCOLOR="#FF9900">	</td>	<TD bgcolor="#FF9900"></TD>	</tr>		<tr><td width="2%"></td>		<Td width="12%" align="center" ><font SIZE=2 ><a href=empdetail.asp?opt=<%=empno%>><%=empno%></a></font></TD>		<td width="25%" ><font SIZE="2" ><%=RS_NAME("NAME")%></font></td>		<td width="10%" ><font size="2"><%=RS_NAME("DESIG_ID")%></font> </td>		<%'IF Weekdayname(weekday(opdate)="monday" or Weekdayname(weekday(opdate)="tuesday" then%>		<TD width="13%"><font SIZE=2 ><%=opdate%></font></TD>		<TD width="11%"><font SIZE=2 ><%=(WeekdayName(Weekday(opdate)))%></font></TD>		<TD width="20%"><font SIZE=2 ><%=reader_in%></font></TD>		<TD width="7%"><font size="2"><%=intime%></font></TD>		<td width="3%"></td>		<!--<TD width="16%"><font SIZE=1 ><%'=reader_out%></font></TD>		<TD width="9%"><font size="1"><%'=outtime%></font></TD>		-->			  </TR>			<%			RS_NAME.CLOSE%>		<%		rs3.movenext		wend'end if		rs3.close		%>	   	<% 		r.movenext		wend		end if		%>	</TABLE></td><tr></table>

Link to comment
Share on other sites

my requirements is after display of records send mail this reports to mail id selected from table click on mail
I'm having problems compiling that sentence, but are you trying to email the HTML report output to someone?
Link to comment
Share on other sites

I don't see a way with ASP to get the contents of the buffer, so you'll need to write the report to a string instead of just displaying it. Hopefully the output is small enough that it won't exceed the memory limit or buffer size. So instead of using response.write or just sending HTML, you need to save everything into a string variable. At the end of the report you can email that to someone and use response.write to print the entire thing at once.

Link to comment
Share on other sites

you could load it into more than string variable and then concatenate the variables together, to avoid exceeding the memory limit.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...