<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!-- #include file="dbsinil1.inc" -->
<!-- #include file="config.inc" -->
<!-- #include file="functions.inc" -->
<% 
on error resume next
%>
<%
Session.Timeout = 120
Server.ScriptTimeout = 5000
busca=request.QueryString("busca")
doc=request.QueryString("doc")
origen=request.QueryString("origen")
Date_ini=Request.Form("Date_ini")
Date_end=Request.Form("Date_end")
lvende=Request.Form("cvende")
criterio22=Request.Form("criterio22")
if criterio22="" then
 xcriterio22=" Todos "
end if
if Date_ini="" or Date_ini=null then
 'Date_ini=date()-(day(date()))+1
 Date_ini=date()
 Date_end=date()
 lhora=right("00"&hour(time),2)
  lmin=right("00"&minute(time),2)
  ltime=lhora&lmin
  if ltime<"0659" then
   Date_ini=date()-1
   Date_end=date()-1
  end if
end if
Date_end3=cdate(Date_end) + 1
'response.write(Date_end)

dia1=right("00"&day(Date_ini),2)
mes1=right("00"&month(Date_ini),2)
anno1=right("00"&year(Date_ini),4)
'Date_inii=cdate(dia1+"/"+mes1+"/"+anno1)
cfechai=cdbl(anno1+mes1+dia1)

dia2=right("00"&day(Date_end3),2)
mes2=right("00"&month(Date_end3),2)
anno2=right("00"&year(Date_end3),4)
'cfechaf=cdate((dia2+"/"+mes2+"/"+anno2))
cfechaf=cdbl(anno2+mes2+dia2)

'''''''''''calcula
 strday = Right("00" & Day(Date_ini), 2)
 strmonth = Right("00" & Month(Date_ini), 2)
 stryear = Right("00" & Year(Date_ini), 4)
 strday2 = Right("00" & Day(Date_end3), 2)
 strmonth2 = Right("00" & Month(Date_end3), 2)
 stryear2 = Right("00" & Year(Date_end3), 4)
 fechainicial = CStr(stryear + strmonth + strday)
 fechafinal2 = CStr(stryear2 + strmonth2 + strday2)

'response.write(fechainicial&" ")
'response.write("FF "&fechafinal)
%>
traer los datos
<html> 

<head>
<meta http-equiv="refresh" content="100000">
<title>Report Corrugator II</title>

<link href="css/style.css" rel="stylesheet" media="screen">

<meta charset="utf-8">
  <title>datepicker demo</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<script type="text/javascript">
$(document).ready(function() {
   $("#datepicker").datepicker();
   $("#datepicker2").datepicker();
});
</script>

<style type="text/css">
<!--
.style8 {font-size: 18pt}
.style16 {
	font-size: 16px;
	font-weight: bold;
}
.style18 {
	font-size: 16;
	font-weight: bold;
	color: #FF0000;
}
-->
</style>
</head>
<body>

<%

set strConexao = CreateObject("ADODB.Connection") ' seteas la conexion
'strConexao.Open("DRIVER=Firebird/InterBase� driver; UID=SYSDBA;PWD=MOLRA; DBNAME=\\desktop-6psmf8k\firebird_db\CARDBOARD20.fdb")

strConexao.Open("DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=molra; DBNAME=192.168.0.201:C:\PAUL\data\CARDBOARD20.FDB")

  Dim objCDO
  Dim Conf
  Dim Fields
'''''''''''

If Err.Number <> 0 then

 'HandleError Err.Description
   response.write("No DATE created")
   mensaje="Can't connect to Database."

'*********************
 correo="ilkim@shinwoousa.com;inwans@shinwoousa.com"
  'Dim objCDO
  'Dim Conf
  'Dim Fields
'''''''''''
  Set cdoConfig = CreateObject("CDO.Configuration")

  With cdoConfig.Fields
   .Item(cdoSendUsingMethod) = 2
   .Item(cdoSMTPServer) = "mail.shinwoousa.com"
   '"64.87.26.218"
   .Item(cdoSMTPauthenticate)=1
   .Item(cdoSendUsername)="sechevarria@shinwoousa.com"
   .Item(cdoSendPassword)="Sergio586*"
   .Item(cdoSMTPServerport)=587
   .Update
  End With

   Set cdoMessage = CreateObject("CDO.Message")
   Set Fields = Nothing
   Set objCDO = Nothing
   Set Conf = Nothing
   With cdoMessage
     Set .Configuration = cdoConfig
     .From = "sechevarria@shinwoousa.com"
    '.To = correo
	'.cc = "jamesoh@shinwoousa.com"
    '.cc = "hlimon@shinwoousa.com;lcorona@shinwoousa.com;avaldez@shinwoousa.com;jmontano@shinwoousa.com;alara@shinwoousa.com;yvizcarra@shinwoousa.com;jamesoh@shinwoousa.com;jvaldez@shinwoousa.com;jmedina@shinwoousa.com;clopez@shinwoousa.com; lramirez@shinwoousa.com; asaldana@shinwoousa.com;kbarrera@shinwoousa.com;dvilchis@shinwoousa.com"
    
	 .bcc = "sechevarria@shinwoousa.com"
      if acthora=7  or acthora=14 then 
       .Subject = "sending Automatic - Corr 2"
	  else
       .Subject = "sending Automatic - Corr 2"
	  end if
    '.TextBody = "Esta es una Prueba de envio automatico ASECO-Sergio"
     .HTMLBody= mensaje
	'.HTMLBody="hola"
    '.AddAttachment (archivopdf)
    '.AddAttachment (archivoxml)
     .Send
   End With
   
   Set cdoMessage = Nothing
   Set cdoConfig = Nothing

else

'abrir la base, fijate que esta en el directorio que la tienes ...
Set Corr2 = Server.CreateObject("ADODB.Recordset") ' seteas el recordset
Set Corr2 = strConexao.Execute("SELECT * FROM PCSIN where jobymd between '" & fechainicial & "' and '" & fechafinal2 & "' and STAT='T' order by JOBYMD,JOBJO,STIME")
'where jobymd between '" & fechainicial & "' and '" & fechafinal & "' order by JOBYMD,JOBJO")
 ' lo ejecutas
'JOBJO,JOBYMD,  JOBSEQ
lturno1="1"
lturno2="1"
%> 
<%
header
%>


<form method="Post" action="corrugator2mailx.asp?busca=ok&origen=<%=origen%>">
<table>
   <tr>
   <td width="54">&nbsp;</td>
   <td width="180">&nbsp;
   </td>
   <td width="146">&nbsp; </td>
   <td width="124">&nbsp;</td>
   <td width="124"> </td>
   </tr>
   <tr>
   <td>Period:</td>
   <td>

   <input type="text" name="Date_ini" id="datepicker" size="20" value="<%=Date_ini%>">

   </td>
   <td><input type="text" name="Date_end" id="datepicker2" size="20" value="<%=Date_end%>">
    </td>
   <td><input type="submit" value="Generate" name="boton1">&nbsp;</td>
   <td>
    </td>
   </tr>
   
   <tr>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td><%=time%></td>
   </tr>
  </table>
</form>


<%
mensaje=mensaje&"<table cellspacing='0' cellpadding='0' border='2'>"
mensaje=mensaje&" <tr><td colspan='17' class='style8'>"& fechainicial &"-"&fechafinal&"<div align='center'> CORRUGATOR 2</div></td>"
mensaje=mensaje&" </tr>"
mensaje=mensaje&"  <tr bgcolor='#AAFFAA'>"
mensaje=mensaje&"    <td width='48' bgcolor='#AAFFAA' class='tool_button style17'>PROD DATE </td>"
mensaje=mensaje&"    <td width='50' bgcolor='#AAFFAA' class='tool_button style17'>Shift</td>"
mensaje=mensaje&"    <td width='50' bgcolor='#AAFFAA' class='tool_button style17'>Start</td>"
mensaje=mensaje&"    <td width='87' bgcolor='#AAFFAA' class='tool_button style17'>ORDER NO.</td>"
mensaje=mensaje&"	<td width='130' bgcolor='#AAFFAA' class='tool_button style17'>CUSTOMER</td>"
mensaje=mensaje&"    <td width='189' bgcolor='#AAFFAA' class='tool_button style17'>BOX ITEM</td>"
mensaje=mensaje&"    <td width='50' bgcolor='#AAFFAA' class='tool_button style17'>FLUTE</td>"
mensaje=mensaje&"    <td width='120' bgcolor='#AAFFAA' class='tool_button style17'>PAPER COMBINATION</td>"
mensaje=mensaje&"    <td width='51' bgcolor='#AAFFAA' class='tool_button style17'>LENGTH</td>"
mensaje=mensaje&"    <td width='67' bgcolor='#AAFFAA' class='tool_button style17'>WIDTH</td>"
mensaje=mensaje&"    <td width='58' bgcolor='#AAFFAA' class='tool_button style17'>TARGET</td>"
mensaje=mensaje&"    <td width='55' bgcolor='#AAFFAA' class='tool_button style17'>PROD QTY</td>"
mensaje=mensaje&"    <td width='50' bgcolor='#AAFFAA' class='tool_button style17'>TOTAL LENGTH (M)</td>"
mensaje=mensaje&"    <td width='61' bgcolor='#AAFFAA' class='tool_button style17'>TOTAL M2</td>"
mensaje=mensaje&"    <td width='61' bgcolor='#AAFFAA' class='tool_button style17'>Bad Qty</td>"
mensaje=mensaje&"    <td width='61' bgcolor='#AAFFAA' class='tool_button style17'>Work Hr</td>"
mensaje=mensaje&"    <td width='61' bgcolor='#FFFF66' class='tool_button style17'>Stop Hr</td>"
mensaje=mensaje&"  </tr>"

 if Not corr2.EOF and Not corr2.BOF then
   TOTML=0
   TOTM2=0
   TOTTARGET=0
   TOTPROD=0
    TOTML=0     
    TOTM2=0
	
	TOTTARGET2=0
    TOTPROD2=0
    TOTML2=0
    TOTM22=0
	TOTbad2=0
	TOTjtime2=0  
    TOTdtime2=0
	TOTITEMS=0
   corr2.movefirst
   'lturno1=Corr2("JOBJO")
   lturno1="1st"
   lturno2="1st"
  Do While Not corr2.EOF
   shora=mid(Corr2("STIME"),10,2)&mid(Corr2("STIME"),13,2)&mid(Corr2("STIME"),16,2)
    Ehora=mid(Corr2("ETIME"),10,2)&mid(Corr2("ETIME"),13,2)&mid(Corr2("ETIME"),16,2)
	
   if (mid(Corr2("STIME"),1,8)=fechainicial and shora<"065001" and Ehora<"065001") then
    CORR2.MoveNext
   else
    if (mid(Corr2("STIME"),1,8)=fechafinal2 and shora>"065000") then
     CORR2.MoveNext
	else
	 
	 if (shora<"065000" and Ehora>"065000") then
	  
	 end if
     lm=int(cdbl(Corr2("Jang"))*cdbl(Corr2("PQTY")))/1000
     lm2=int((cdbl(Corr2("Jang"))*cdbl(Corr2("WPOK")))*cdbl(Corr2("PQTY")))/1000000
     totalTiempo = cdbl(corr2("dtime"))
     hores = int((totalTiempo/3600))
     aux = int(totalTiempo-(3600*hores))
     minuts = int(aux/60)
     segons = totalTiempo-hores*3600-minuts*60
     Downtime = hores&":"&right("00"&minuts,2)&":"&right("00"&segons,2)
     Tiempo2 = cdbl(corr2("jtime"))
     hores2 = int((Tiempo2/3600))
     aux2 = int(Tiempo2-(3600*hores2))
     minuts2 = int(aux2/60)
     segons2 = Tiempo2-hores2*3600-minuts2*60
     Worktime = hores2&":"&right("00"&minuts2,2)&":"&right("00"&segons2,2)
     lstime=mid(Corr2("stime"),10,8)
     letime=mid(Corr2("etime"),10,8)

     
     mensaje=mensaje&"  <tr>"
     mensaje=mensaje&"    <td class='xl67'>"&mid(Corr2("STIME"),1,8)&"</td>"
	 mensaje=mensaje&"    <td class='xl68'>"& corr2("JOBJO")&" </td>"
     mensaje=mensaje&"    <td class='xl67'>"&lstime&"-"&letime&"</td>"
     mensaje=mensaje&"    <td class='xl68'>"& corr2("SUJUNO")&" </td>"
     mensaje=mensaje&"	  <td class='xl68'>"& corr2("CUST")&"</td>"
     mensaje=mensaje&"    <td class='xl68'>"& corr2("BOXName")&" </td>"
     mensaje=mensaje&"    <td class='xl68'>"& corr2("GOL")&"</td>"
     mensaje=mensaje&"    <td class='xl68'>"& corr2("BEHAP")&" </td>"
     mensaje=mensaje&"    <td class='xl68' align='right'>"& corr2("JANG")&" </td>"
     mensaje=mensaje&"    <td class='xl68' align='right'>"& corr2("WPOK")&" </td>"
     mensaje=mensaje&"    <td class='xl68' align='right'>"& corr2("QTY")&"</td>"
     mensaje=mensaje&"    <td class='xl68' align='right'>"& corr2("PQTY")&" </td>"
     mensaje=mensaje&"    <td class='xl68' align='right'>"& formatnumber(lm,0)&" </td>"
     mensaje=mensaje&"    <td class='xl68' align='right'>"& formatnumber(lm2,0) &"</td>"
     mensaje=mensaje&"<td class='xl68' align='right'>"&corr2("EQTY")&" </td>"
     mensaje=mensaje&"<td class='xl68' align='right'>"& worktime&" </td>"
     mensaje=mensaje&"<td class='xl68' align='right'>"& downtime&" </td>"
     mensaje=mensaje&"  </tr>"	
	
      TOTTARGET=TOTTARGET+cdbl(corr2("QTY"))
      TOTPROD=TOTPROD+cdbl(corr2("PQTY"))
      TOTML=TOTML+lm       '(corr2("JANG")*corr2("PQTY")/1000)
      TOTM2=TOTM2+lm2      '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
	  TOTbad=TOTbad+cdbl(corr2("eQTY"))
 	
      TOTjtime=TOTjtime+cdbl(corr2("jtime"))
      TOTdtime=TOTdtime+cdbl(corr2("dtime"))
	
      TOTTARGET2=TOTTARGET2+cdbl(corr2("QTY"))
      TOTPROD2=TOTPROD2+cdbl(corr2("PQTY"))
      TOTML2=TOTML2+lm       '(corr2("JANG")*corr2("PQTY")/1000)
      TOTM22=TOTM22+lm2      '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
	 
      TOTbad2=TOTbad2+cdbl(corr2("eQTY"))
	  TOTjtime2=TOTjtime2+cdbl(corr2("jtime"))
      TOTdtime2=TOTdtime2+cdbl(corr2("dtime"))
      TOTITEMS=TOTITEMS+1
	  TOTITEMS2=TOTITEMS2+1
  	 if shora>"065000" and shora<"152001" then
	  lTurno1="1st"
	 end if
	 if shora>"152000" and shora<"232001" then
	  lTurno1="2nd"
	 end if
	 if shora>"232000" or shora<"065001" then
	  lTurno1="3rd"
	 end if
	
      CORR2.MoveNext
       if not Corr2.eof then
	  
        shora2=mid(Corr2("STIME"),10,2)&mid(Corr2("STIME"),13,2)&mid(Corr2("STIME"),16,2)
 	    if shora2>"065000" and shora2<"152001" then
 	     lturno2="1st"
 	    end if
	    if shora2>"152000" and shora2<"232001" then
	     lturno2="2nd"
	    end if
	    if shora2>"232000" or shora2<"065001" then
	     lturno2="3rd"
	    end if
	  
       'lturno2=xTurno
       end if	
    end if
   end if   
	 
	
	if Corr2.eof or lturno1<>lturno2 then
	 
	 if TOTML2>0 and (TOTjtime2+TOTdtime2)>0 then
	  lspeedtot2=int(TOTML2/((TOTjtime2+TOTdtime2)/60))
     else
	  lspeedtot2=0
	 end if
	 
	  mensaje=mensaje&"  <tr>"
      mensaje=mensaje&"    <td class='xl67'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl67'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl68'><strong>Total Shift</strong></td>"
      mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl68'>"& formatnumber(TOTITEMS2,0) &"</td>"
      mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl68' align='right'>&nbsp;</td>"
      mensaje=mensaje&"    <td class='xl68' align='right'>&nbsp;</td>"
      mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTTARGET2,0)&"</strong></DIV></td>"
      mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTPROD2,0)&"</strong></DIV></td>"
      mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTML2,0) &"&nbsp;M</strong></DIV></td>"
      mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTM22,0) &"&nbsp;M2</strong></DIV></td>"
      mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTbad2,0) &"&nbsp;</strong></DIV></td>"
      mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong></strong></DIV></td>"
      mensaje=mensaje&"    <td align='right' bgcolor='FFFF66' class='xl68'><div align='right' class=style15><strong></strong></DIV></td>"
      mensaje=mensaje&"  </tr>"
	  TOTITEMS2=0
	  if  TOTTARGET2>0 then
	   lturno1=lturno2
	   TOTTARGET2=0
       TOTPROD2=0
       TOTML2=0
       TOTM22=0
	   TOTbad2=0
	   TOTjtime2=0
       TOTdtime2=0
	   lspeedtot2=0
	  end if
    end if
  
 LOOP
'END IF
corr2.close
end if
''''''''''''''''''''''''
 if totitems>0 then
  lspeedtot=int(TOTML/((TOTjtime+TOTdtime)/60))
  Tiempod = TOTdtime
  hores3 = int((Tiempod/3600))
  aux3 = int(Tiempod-(3600*hores3))
  minuts3 = int(aux3/60)
  segons3 = Tiempod-hores3*3600-minuts3*60
  totdt2 = hores3&":"&right("00"&minuts3,2)&":"&right("00"&segons3,2)

  Tiempow = totjtime
  hores4 = int((Tiempow/3600))
  aux4 = int(Tiempow-(3600*hores4))
  minuts4 = int(aux4/60)
  segons4 = Tiempow-hores4*3600-minuts4*60
  totwt2 = hores4&":"&right("00"&minuts4,2)&":"&right("00"&segons4,2)
  
   mensaje=mensaje&"  <tr>"
   mensaje=mensaje&"    <td class='xl67'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl67'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl68'><strong>TOTAL </strong></td>"
   mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl68'>"& formatnumber(TOTITEMS,0) &"</td>"
   mensaje=mensaje&"    <td class='xl68'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl68' align='right'>&nbsp;</td>"
   mensaje=mensaje&"    <td class='xl68' align='right'>&nbsp;</td>"
   mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTTARGET,0)&"</strong></DIV></td>"
   mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTPROD,0)&"</strong></DIV></td>"
   mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTML,0) &"&nbsp;M</strong></DIV></td>"
   mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTM2,0) &"&nbsp;M2</strong></DIV></td>"
   mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&FORMATNUMBER(TOTbad,0) &"&nbsp;</strong></DIV></td>"
   mensaje=mensaje&"    <td align='right' bgcolor='#D2D2D2' class='xl68'><div align='right' class=style15><strong>"&TOTwt2 &" hrs</strong></DIV></td>"
   mensaje=mensaje&"    <td align='right' bgcolor='FFFF66' class='xl68'><div align='right' class=style15><strong>"&TOTdt2 &" hrs</strong></DIV></td>"
   mensaje=mensaje&"  </tr>"
 end if

mensaje=mensaje&"</TABLE>"

 
'Corr2.Close 
strConexao.Close 
Set strConexao=Nothing 

 '*********************
 correo="ilkim@shinwoousa.com;inwans@shinwoousa.com"
  'Dim objCDO
  'Dim Conf
  'Dim Fields
'''''''''''
  Set cdoConfig = CreateObject("CDO.Configuration")

  With cdoConfig.Fields
   .Item(cdoSendUsingMethod) = 2
   .Item(cdoSMTPServer) = "mail.shinwoousa.com"
   '"64.87.26.218"
   .Item(cdoSMTPauthenticate)=1
   .Item(cdoSendUsername)="sechevarria@shinwoousa.com"
   .Item(cdoSendPassword)="Sergio586*"
   .Item(cdoSMTPServerport)=587
   .Update
  End With

   Set cdoMessage = CreateObject("CDO.Message")
   Set Fields = Nothing
   Set objCDO = Nothing
   Set Conf = Nothing
   With cdoMessage
     Set .Configuration = cdoConfig
     .From = "sechevarria@shinwoousa.com"
    '.To = correo
	'.cc = "jamesoh@shinwoousa.com"
    '.cc = "hlimon@shinwoousa.com;lcorona@shinwoousa.com;avaldez@shinwoousa.com;jmontano@shinwoousa.com;alara@shinwoousa.com;yvizcarra@shinwoousa.com;jamesoh@shinwoousa.com;jvaldez@shinwoousa.com;jmedina@shinwoousa.com;clopez@shinwoousa.com; lramirez@shinwoousa.com; asaldana@shinwoousa.com;kbarrera@shinwoousa.com;dvilchis@shinwoousa.com"
    
	 .bcc = "sechevarria@shinwoousa.com"
      if acthora=7  or acthora=14 then 
       .Subject = "sending Automatic - Corr 2"
	  else
       .Subject = "sending Automatic - Corr 2"
	  end if
    '.TextBody = "Esta es una Prueba de envio automatico ASECO-Sergio"
     .HTMLBody= mensaje
	'.HTMLBody="hola"
    '.AddAttachment (archivopdf)
    '.AddAttachment (archivoxml)
     .Send
   End With
   
   Set cdoMessage = Nothing
   Set cdoConfig = Nothing


end if    ' si hay error

%>
</body> 
</html> 
