enviar correo electronico / send eMail

HMG en Español

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

enviar correo electronico / send eMail

Post by Pablo César »

mol wrote:I want to call default program defined by "default programs" from control panel.
It can be outlook, outlook express, thundirbird.
Marek, most probably to get Default Mail Client (for all Windows) is to read REGISTER at:

[HKEY_CLASSES_ROOT\mailto\shell\open\command]
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: enviar correo electronico / send eMail

Post by andyglezl »

Hola mol

Yo lo utilizo de esta forma y se envia por medio del Outlook de Office que tengo instalado...
-----------------------------------------------------------------------------------------
Hello mol

I use it in this way and is sent through Office Outlook I have installed ...

Code: Select all

        cTemp := "url.dll,FileProtocolHandler "
        cTemp += "mailto:"+cCTEMAIL
        cTemp += "&subject=Confirmacion de Cita - ("+cEmp+")"
        cTemp += "&body="
        cTemp += "Enviado el "+DTOC(date())+" a las "+TIME()+cSaltLin+cSaltLin
        cTemp += cEmp+cSaltLin
        cTemp += cDirecci+cSaltLin
        cTemp += "Tel: "+cTelefon+cSaltLin
        cTemp += cCiudad+cSaltLin+cSaltLin
        cTemp += "     CLIENTE:     "+V2S(cpso4)+cSaltLin
        cTemp += "        CITA:     "+FechTex(cpso2)+" a las "+V2S(cpso3)+cSaltLin
        cTemp += "  Le Atiende:     "+V2S(cpso5)+cSaltLin+cSaltLin       // +" - ( "+V2S(cpso6)+" )"
        cTemp += "Obsevaciones:     "+V2S(cpso7)+cSaltLin+cSaltLin+cSaltLin
        cTemp += "Estimado(a) "+SUBSTR(V2S(cpso4),7)+cSaltLin+cSaltLin
        cTemp += "Su Cita ha sido registrada, favor de confirmar su asistencia"+cSaltLin
        cTemp += "dentro del siguiente periodo para hacerla efectiva."+cSaltLin+cSaltLin
        cTemp += "Inicio:  "+cSaltLin
        cTemp += "   Fin:  "+cSaltLin+cSaltLin
        cTemp += "En caso de NO confirmar su asistencia en el periodo señalado,"+cSaltLin+cSaltLin
        cTemp += "se cancelará para reasignarla a otra persona.,"+cSaltLin+cSaltLin
        cTemp +="******************************************************"+cSaltLin+cSaltLin
        ShellExecute(0, "open", "rundll32.exe", cTemp, , 1)

Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: enviar correo electronico / send eMail

Post by mol »

Thanks!
I'll try it with thunderbird.

edit:

I've tested and I can call my default email program - thunderbird.

But, how to split address from topic and body? Could you post variable values?
How to attach one or list of files to created message?

Regards, Marek

edit:
I've tried this way:

Code: Select all

#include <hmg.ch>

function main 
cTemp := "url.dll,FileProtocolHandler "
        cTemp += "mailto:Marek (mol@pro.onet.pl)"+"?"
        cTemp += "&subject=Próba wysyłki maila"+"?"
        cTemp += "&body=tutaj jakaś przykładowa treść"
		cTemp += "&Attach=c:\\projekty\\testy\\email z windowsa\\wyslijemail.prg"
        ShellExecute(0, "open", "rundll32.exe", cTemp, , 1)
return
everything works ok against attachment :-(
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: enviar correo electronico / send eMail

Post by andyglezl »

Lo siento mol... :oops:
Sorry mol ... :oops:

Code: Select all

LOCAL cSaltLin:= "%0D%0A"

cTemp := "url.dll,FileProtocolHandler "
        cTemp += "mailto:Marek (mol@pro.onet.pl)"+cSaltLin
        cTemp += "&subject=Próba wysyłki maila"+cSaltLin
        cTemp += "&body=tutaj jakaś przykładowa treść"
      cTemp += "&Attach=c:\\projekty\\testy\\email z windowsa\\wyslijemail.prg"
        ShellExecute(0, "open", "rundll32.exe", cTemp, , 1)
Yo no he utilizado el Attach... Será cuestion de investigar...
------------------------------------------------------------------
I have not used the Attach ... It will be a matter of researching ...
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: enviar correo electronico / send eMail

Post by AidTIC »

Buenas tarde,
Como puedo añadirle un destinatario oculto ??
Puedo decir desde que cuenta se envia?

*-*-*-*-*-*-*-*-*-*-*-
Good afternoon,
As I can add a hidden recipient ??
I can say from that account is sent?
*-*-*-*-*-*-*-*-*-*-*-*-*

oOutLook := CreateObject("Outlook.Application")
oMail := oOutLook:CreateItem(0)
oRecip := oMail:Recipients
oRecip:Add( cDestino )

oAdjunto:=oMail:Attachments
Skydone Solutions
www.skydone.com
trmpluym
Posts: 303
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands

Re: enviar correo electronico / send eMail

Post by trmpluym »

I can help you with the BCC

oMail:BCC:="test@test.com"

Theo
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: enviar correo electronico / send eMail

Post by danielmaximiliano »

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: enviar correo electronico / send eMail

Post by AidTIC »

Ok, lo pruebo esta tarde y os cuento.

No habría documentación para poder ver toldos los parámetros y variables?

Pues estaba intentado crear el correo con las imágenes embebidas, type mime, y no doy con la tecla.

Gracias
Skydone Solutions
www.skydone.com
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: enviar correo electronico / send eMail

Post by AidTIC »

hola, Ya lo he solucionado,era un error al transcribir la variable. Gracias

acabo de probarlo

cdestino :="ejemplo@domio.com"
oMail := oOutLook:CreateItem(0)
oRecip := oMail:Recipients
oRecip:Add( cDestino )
oMail:BCC:= "ejemplo@domio.com"


Solo me crea el correo con la cuenta BCC la Para, me la deja en blanco

cdestino :="ejemplo@domio.com"
oMail := oOutLook:CreateItem(0)
oRecip := oMail:Recipients
oRecip:Add( "ejemplo@domio.com")
oMail:BCC:= "ejemplo@domio.com"


Asi si que me crea el PARA y el CCO, pero claro, necesito utilizar la variable.

he probado también
oMail:to := "ejemplo@domio.com" y oMail:to := cDestino
pero lo mismo

Que puede pasar, estoy gastando hmg.3.4.2
Skydone Solutions
www.skydone.com
User avatar
AidTIC
Posts: 117
Joined: Mon Apr 22, 2013 8:29 am
DBs Used: DBF
Contact:

Re: enviar correo electronico / send eMail

Post by AidTIC »

Me faltaría saber como puedo decir desde que cuenta se envía?

Tengo varias cuentas configuradas en Outlook, y cuando mando siempre me coge la cuenta predeterminada, hay manera que me coja la que yo le indique?

*-*-*-*-*-*-*-*-*-*-*-
Fail me know how I can say is sent from that account?

I have multiple accounts configured in Outlook, and as always send me take the default account, no way I hold my instructed?
*-*-*-*-*-*-*-*-*-*-*-*-*

cdestino :="ejemplo@domio.com"
oMail := oOutLook:CreateItem(0)
oRecip := oMail:Recipients
oRecip:Add( cDestino )
oMail:BCC:= "ejemplo@domio.com"
Skydone Solutions
www.skydone.com
Post Reply