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.
Send Mail
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Send Mail
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Send Mail
Good question, good and motivated idea !
Probably Maximiliano Daniel has a good example...
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
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Send Mail
I'm pretty glad to have a moderator approbationPablo César wrote:Good question, good and motivated idea !
Thanks!
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Send Mail
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.
otra opcio seria agregarlo en una variable separados por una coma (;)
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
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
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
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- Roberto Lopez
- HMG Founder
- Posts: 4004
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Send Mail
Muchísimas Gracias Daniel. Me ahorraste innumerables horas de trabajo (Thank you very much Daniel. You saved me a lot of work).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.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: Send Mail
It is really good to have good examples, thank you master !Roberto Lopez wrote:I'm pretty glad to have a moderator approbationPablo César wrote:Good question, good and motivated idea !
Thanks!
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
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein