enviar correo electronico / send eMail

HMG en Español

Moderator: Rathinagiri

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

enviar correo electronico / send eMail

Post by Pablo César » Fri Aug 22, 2014 11:14 am

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: 835
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 7 times
Been thanked: 20 times
Contact:

Post by andyglezl » Fri Aug 22, 2014 2:48 pm

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: 2801
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 112 times
Been thanked: 52 times
Contact:

Post by mol » Fri Aug 22, 2014 2:51 pm

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: 835
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 7 times
Been thanked: 20 times
Contact:

Post by andyglezl » Fri Aug 22, 2014 5:11 pm

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.

AidTIC
Posts: 58
Joined: Mon Apr 22, 2013 8:29 am
Been thanked: 2 times

Post by AidTIC » Tue May 17, 2016 5:53 pm

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

trmpluym
Posts: 192
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 4 times
Been thanked: 11 times

Post by trmpluym » Tue May 17, 2016 7:50 pm

I can help you with the BCC

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

Theo

User avatar
danielmaximiliano
Posts: 2028
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 74 times
Been thanked: 11 times
Contact:

Post by danielmaximiliano » Wed May 18, 2016 1:10 am

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

AidTIC
Posts: 58
Joined: Mon Apr 22, 2013 8:29 am
Been thanked: 2 times

Post by AidTIC » Wed May 18, 2016 11:41 am

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

AidTIC
Posts: 58
Joined: Mon Apr 22, 2013 8:29 am
Been thanked: 2 times

Post by AidTIC » Wed May 18, 2016 2:56 pm

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

AidTIC
Posts: 58
Joined: Mon Apr 22, 2013 8:29 am
Been thanked: 2 times

Post by AidTIC » Mon May 23, 2016 11:42 am

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"

Post Reply