Send Mail

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Send Mail

Post by Roberto Lopez »

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

Re: Send Mail

Post by Pablo César »

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: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Send Mail

Post by Roberto Lopez »

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: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Send Mail

Post by danielmaximiliano »

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Send Mail

Post by Roberto Lopez »

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

Re: Send Mail

Post by Pablo César »

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