TSMTP de Luis Krause / Tamaño 0 en ficheros adjuntos

TSMTP de Luis Krause / Tamaño 0 en ficheros adjuntos

Postby RPATON » Sun Aug 05, 2007 7:05 pm

Hola:
Estoy utilizando la clase TSMTP de Luis Krause para envío de ficheros .ZIP junto con el mensaje.
El mensaje se envío pero el tamaño del fichero que llega es cero.

¿Que puedo estar haciendo mal?

Saludos.
Ricardo Patón


FUNCTION SendMail(cMailDes)
LOCAL oInit

// initialize sockets (or nothing will happen) - it's a quirk in GetHostByName(), not TSmtp
oInit := TSmtp():New( alltrim(empre2->ipsmtp) )

// no let's go for our socket
oMail := TSmtp():New( alltrim(empre2->ipsmtp), , empre2->laut, alltrim(empre2->usuario), alltrim(empre2->clave), "ENVIO FICHEROS MAESTROS" ) // [jlalin], IBTC
* oMail:cReplyTo := cReplyTo
oMail:nGMT := 8 // 8 = Pacific Standard Time (GMT -08:00) - Adjust this to your own Time Zone!

// uncomment next line if you experience problems while sending email
// descomentar sig. l¡nea en caso de experimentar problemas al enviar correo
oMail:nDelay := 1

* oMail:lTxtAsAttach := .F. // uncomment to force txt, log and htm files as inline as opposed to attachement
oMail:oSocket:lDebug := .T. // uncomment to create log file
oMail:oSocket:cLogFile := "smtp.log"

* oMail:bConnecting := {|| oWnd:SetMsg( "Connecting to " + cHost + " (" + oMail:cIPServer + ") and waiting for response..." ) }
* oMail:bConnected := {|| oWnd:SetMsg( "Connected and sending mail and attachments..." ) }

oMail:SendMail( ;
alltrim(empre2->mailori), ; // from/de
{ alltrim(cMailDes) }, ; // to/para (arreglo) - I use cSender here also because it's an "autotest". Actually you would type a different address here
"Ficheros Maestros para AUXTAJO",; // Body/Mensaje
"Ficheros Maestros:"+dtoc(date())+" "+time(),; // Subject/Asunto
{"c:\prueba.zip" }, ; // Array of filenames to attach/Arreglo de nombres de archivos a agregar
{ }, ; // aCC
{ }, ; // aBCC
.F., ; // Return Receipt/acuse de recibo
"" ) // msg in HTML format/mensaje en HTML

oInit:end()

return nil
RPATON
 
Posts: 41
Joined: Tue Mar 28, 2006 8:21 pm
Location: CIUDAD REAL (ESPAÑA)

TSMTP solucion adjuntar ficheros

Postby RPATON » Mon Aug 06, 2007 3:25 pm

Hola:
Resuelto el problema. SendFile de TSOCKET.PRG no veía el fichero temporal que se genera con TmpFile(). Le he puesto una ruta fija y todo funciona bien recibiendo el fichero con tamaño.

Saludos.

Ricardo Patón
RPATON
 
Posts: 41
Joined: Tue Mar 28, 2006 8:21 pm
Location: CIUDAD REAL (ESPAÑA)

Postby Antonio Linares » Mon Aug 06, 2007 5:42 pm

Gracias Ricardo por compartir la solución :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41439
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para CA-Clipper

Who is online

Users browsing this forum: No registered users and 1 guest