About CDOSYS (Collaboration Data Objects) and attachments

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
salamandra
Posts: 132
Joined: Thu Jul 31, 2008 8:33 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 1 time

About CDOSYS (Collaboration Data Objects) and attachments

Post by salamandra » Mon Jun 11, 2012 6:35 pm

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: 2090
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 115 times
Been thanked: 15 times
Contact:

Post by danielmaximiliano » Tue Jun 12, 2012 12:30 am

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 3235 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
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
danielmaximiliano
Posts: 2090
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 115 times
Been thanked: 15 times
Contact:

Post by danielmaximiliano » Tue Jun 12, 2012 12:48 am

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 3231 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")

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
salamandra
Posts: 132
Joined: Thu Jul 31, 2008 8:33 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 1 time

Post by salamandra » Tue Jun 12, 2012 10:16 am

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: 132
Joined: Thu Jul 31, 2008 8:33 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 1 time

Post by salamandra » Tue Jun 12, 2012 3:15 pm

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