Send Mail

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 3980
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Send Mail

Post by Roberto Lopez » Sun Dec 21, 2014 11:07 pm

Hi All,

I must to send holidays cards to a list of contacts via e-mail.

Which is the best way to do it in current Harbour version?

Any Harbour/HMG sample?

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Mon Dec 22, 2014 12:12 am

Good question, good and motivated idea !

Probably Maximiliano Daniel has a good example...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Roberto Lopez
HMG Founder
Posts: 3980
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post by Roberto Lopez » Mon Dec 22, 2014 1:10 am

Pablo César wrote:Good question, good and motivated idea !
I'm pretty glad to have a moderator approbation :)

Thanks!
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
danielmaximiliano
Posts: 2183
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 187 times
Been thanked: 29 times
Contact:

Post by danielmaximiliano » Mon Dec 22, 2014 1:13 am

Hola Roberto :

Funciona 100% y con el menos codigo posible es utilizar CDOSYS ya que la libreria HBTIP hay que compilar y agregar esas librerias a HMG y es un poco engorroso utilizar.

una opcion seria recorrer todos los contactos a enviar E-mail y enviarlos de uno en uno en un bucle.

Code: Select all

loMsg := CREATEOBJECT ( "CDO.Message" )
      WITH OBJECT loMsg
         :Configuration   := loCfg
         :From                := Main.cFrom.Value
         :To                    := "xContact@Server.com"   // <-----       Coloca aqui  tu direcci¢n de correo
         :Subject             := "Prueba con DO"
         :TextBody          := Main.Contenido.Value
         :AddAttachment := "c:\Main.prg"         /*** Lineas a agregar ****/
         :Send()
      ENDWITH

otra opcio seria agregarlo en una variable separados por una coma (;)

Code: Select all

loMsg := CREATEOBJECT ( "CDO.Message" )
      WITH OBJECT loMsg
         :Configuration   := loCfg
         :From                := Main.cFrom.Value
         :To                    := "xContact@Server.com ; yContact@Server.com"  
         :Subject             := "Prueba con DO"
         :TextBody          := Main.Contenido.Value
         :AddAttachment := "c:\Main.prg"         /*** Lineas a agregar ****/
         :Send()
      ENDWITH
y tambien seria una mejor opcion intenta que no se vea la lista en "NO" usar :To sino :BCC

revisa este link para mejor comprension sobre CDOSYS...
http://hmgforum.com/viewtopic.php?f=24& ... sys#p20438
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
Roberto Lopez
HMG Founder
Posts: 3980
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 27 times
Been thanked: 168 times

Post by Roberto Lopez » Mon Dec 22, 2014 1:23 am

danielmaximiliano wrote:Hola Roberto :

Funciona 100% y con el menos codigo posible es utilizar CDOSYS ya que la libreria HBTIP hay que compilar y agregar esas librerias a HMG y es un poco engorroso utilizar.

una opcion seria recorrer todos los contactos a enviar E-mail y enviarlos de uno en uno en un bucle.
Muchísimas Gracias Daniel. Me ahorraste innumerables horas de trabajo (Thank you very much Daniel. You saved me a lot of work).
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Mon Dec 22, 2014 10:34 am

Roberto Lopez wrote:
Pablo César wrote:Good question, good and motivated idea !
I'm pretty glad to have a moderator approbation :)

Thanks!
:lol: It is really good to have good examples, thank you master !

Gracias Daniel por tu atencion de siempre !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Post Reply