About CDOSYS (Collaboration Data Objects) and attachments

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

About CDOSYS (Collaboration Data Objects) and attachments

Post by salamandra »

Hi to all :) ,
I tested the sample code posted by Daniel Maximiliano using Collaboration Data Objects
and really it worked fine to sending only email without attachments.
viewtopic.php?f=5&t=1518&p=20113#p20113
Anybody knows how to get CDO working properly with attachments ??

TIA,


[]´s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: About CDOSYS (Collaboration Data Objects) and attachment

Post by danielmaximiliano »

Hi / Hola Salamandra :

CdoSys tiene como enviar un archivo adjunto , eh intentado activar dicha funcion pero me da error, estoy investigando cual es la falla,apenas lo resuelva subo la modificacion.

Translate Google

CdoSys is to send an attachment, eh tried to activate this function but I get error, I am researching which is the fault, just upload the modified work it out.
error.jpg
error.jpg (81.13 KiB) Viewed 6654 times

Code: Select all

      loMsg := CREATEOBJECT ( "CDO.Message" )
      WITH OBJECT loMsg
         :Configuration := loCfg
         :From          := Main.cFrom.Value
         :To            := Main.cTo.Value    // <-----       Coloca aqui  tu direcci¢n de correo
         :Subject       := "Prueba con DO"
         :TextBody      := Main.Contenido.Value
         :AddAttachment := "c:\Main.prg"         /*** Lineas a agregar ****/
         :Send()
      ENDWITH
Nota sobre archivos adjuntos : si se desea enviar varios archivos en el mismo mensaje , se debe ejecutar el método para cada archivo, por ejemplo :

CDO.AddAttachment (Adjunto 1)
CDO.AddAttachment (Adjunto 2)
CDO.AddAttachment (Adjunto 3)

... resto de código
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: About CDOSYS (Collaboration Data Objects) and attachment

Post by danielmaximiliano »

CdoSys tiene como enviar un archivo adjunto , eh intentado activar dicha funcion pero me da error, estoy investigando cual es la falla,apenas lo resuelva subo la modificacion.

Translate Google

CdoSys is to send an attachment, eh tried to activate this function but I get error, I am researching which is the fault, just upload the modified work it out.
ya encontre la solucion
mail.jpg
mail.jpg (81.92 KiB) Viewed 6650 times

Code: Select all

      loMsg := CREATEOBJECT ( "CDO.Message" )
      WITH OBJECT loMsg
         :Configuration := loCfg
         :From          := Main.cFrom.Value
         :To            := Main.cTo.Value    
         :Subject       := "Prueba con DO"
         :TextBody      := Main.Contenido.Value
         :AddAttachment("c:\Main.prg")
         :Send()
      ENDWITH
if you need more upload attachments / si se necesitan cargar mas adjuntos

Code: Select all

  :AddAttachment("c:\Main.prg","file2","file3",more,,)

or

 :AddAttachment("c:\Main.prg")
 :AddAttachment("File2")

*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: About CDOSYS (Collaboration Data Objects) and attachment

Post by salamandra »

Hi Daniel :) ,
Thanks you for your reply.
I´ll try this way and post result here.


[]´s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: About CDOSYS (Collaboration Data Objects) and attachment

Post by salamandra »

Hi Daniel :) ,
Tested the following code and it worked fine :P

Code: Select all

loMsg := CREATEOBJECT ( "CDO.Message" )
WITH OBJECT loMsg
	:Configuration := loCfg
	:From          := Main.cFrom.Value
	:To            := Main.cTo.Value
	:Subject       := "e-Mail test using <<< CDOSYS (Collaboration Data Objects) >>>"
	:TextBody      := Main.Contenido.Value
	For k:=1 to Main.archivos.ItemCount
		:AddAttachment(Main.archivos.Item(k))
	Next k
	:Send()
ENDWITH
Thanks again for your help :D

[]´s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
Post Reply