best way to Send an Email from Harbour

1,470 views
Skip to first unread message

L.

unread,
Jan 19, 2012, 1:22:24 PM1/19/12
to Harbour Users
Hello,

Which is the best way to send an email from Harbour?.

I don´t want to use CDO as sometimes fails and the errors are not very
clear.

Thanks.

Gmail

unread,
Jan 19, 2012, 1:49:22 PM1/19/12
to harbou...@googlegroups.com
Hello Lucas,

How do use CDO? Do you have an example?
I use hb_sendMail() or win_MAPIsendMail() but there is also BLAT
integration (I don't use it).
BTW are you going to use it in Windows or you plan to use under Linux
too?
Regards,

Qatan


Hello,

Thanks.

--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

L.

unread,
Jan 19, 2012, 2:28:06 PM1/19/12
to Harbour Users
Hello,

Thanks for helping me.

Do you have a hb_sendmail() sample please?.

Sometomes I got errors with cdo.

This is a working sample:

#include "FiveWin.ch"
*#include "CdoSys.ch"
*#include "FGet.ch"
#include "Fileio.ch"

#define WS_3DLOOK 4
#define CLR_HBROWN nRGB( 205, 192, 176 )
#define CLR_NBLUE nRGB( 142, 171, 194 )
*
STATIC oDlg, oFont, oFont2
STATIC cMailServer,; //:= PadR( "smtp.gmail.com",
60 ), ; // servidor de correo
cFrom ,; //:= PadR( "remi...@gmail.com",
60 ), ; // remitente
nPort ,; //:=
465, ; // puerto usado por el
servidor de correo
cUser ,; //:=
Space( 60 ), ; // nombre de usuario para
autenticación
cPass //:=
Space( 30 ) // contraseña para
autenticación
STATIC nLine := 1
//--------------------------------------------------------------------------------------------------------------------//

*Function fEmail(cMailServer, cFrom, cnPort, cUser, cPass )
Function fEmail(cTo) // Recibe como parámetro el correo electrónico
del cliente

*local hBorland := LoadLibrary("SgemBW32.DLL")
Local oDlg, oFont, oFont2, oFont3
Local oGet1, oGet2, oGet3, oGet4, oGet5
Local oBt1, oBt2, oBt3
Local cnPort:=25
Local cNombre:= ""
local cBcc := SPACE(600),;
cSubject:=SPACE(120),;
cAttach:=SPACE(600),;
cBody :=SPACE(800)

Local hIniFile
*
cTo:=Space(80)
IF cto == NIL
cTo := PadR( cTo, 180 )
ELSE
* cNombre := SayGetClien() // forma parte de mis
librerias
cTo := PadR( "xxx...@xxsssss.com", 180 )
ENDIF
*
IF !FILE( "emailCdo.ini" )
CreaIni()
ENDIF

/*
*
ReadIni() // proporciona los valores static
*
INI oIni FILENAME ( "emailcdo.ini" )
GET cMailServer SECTION 'SETUPMAIL' ENTRY 'MailServer' OF
oIni
GET nPort SECTION 'SETUPMAIL' ENTRY 'puerto' OF
oIni
GET cuser SECTION 'SETUPMAIL' ENTRY 'usuario' OF
oIni
GET cpass SECTION 'SETUPMAIL' ENTRY 'password' OF
oIni
GET cFrom SECTION 'SETUPMAIL' ENTRY 'remitente' OF
oIni
ENDINI

*/
hIniFile := HB_ReadIni( "emailcdo.ini" )
cMailServer :=hIniFile["SETUPMAIL"]["MailServer"]
nPort :=hIniFile["SETUPMAIL"]["puerto"]
cuser :=hIniFile["SETUPMAIL"]["usuario"]
cpass :=hIniFile["SETUPMAIL"]["password"]
cFrom :=hIniFile["SETUPMAIL"]["remitente"]


DEFINE FONT oFont NAME "Arial" SIZE 0, -16
DEFINE FONT oFont2 NAME "Arial" SIZE 0, -10
DEFINE FONT oFont3 NAME "Arial" SIZE 0, -14
nPort := cnPort
DEFINE DIALOG oDlg RESOURCE "Email" ;
COLORS CLR_BLUE, CLR_LIGHTGRAY /*;
STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,
WS_3DLOOK )*/

oDlg:lHelpIcon := .F.
oDlg:cCaption := "Mensaje Electrónco para - " // +cNombre
oDlg:bKeydown := {|nKey| if( nKey == VK_F12 , ;

(SetupMail(cMailServer, nPort, cUser, cPass, cFrom), ;
oDlg:Setfocus()),
Nil) }

REDEFINE GET oGet1 VAR cTo OF oDlg ; //
Destinatario
ID 101 ;
FONT oFont2 UPDATE PICTURE "@KS60" ;
COLORS CLR_BLUE, CLR_WHITE //SIZE 264, 11 PIXEL

REDEFINE GET oGet2 VAR cBCC OF oDlg ; //
con copia a
ID 102 ;
FONT oFont2 UPDATE PICTURE "@KS60" ;
COLORS CLR_BLUE, CLR_WHITE //SIZE 264, 11 PIXEL

REDEFINE GET oGet3 VAR cSubject OF oDlg ; //
Asunto
ID 103 ;
FONT oFont2 UPDATE PICTURE "@KS60" ;
COLORS CLR_BLUE, CLR_WHITE

REDEFINE GET oGet4 VAR cAttach OF oDlg ; // anexos
PICTURE "@KS60" ;
ID 104 ;
FONT oFont2 UPDATE ;
COLORS CLR_BLUE, CLR_WHITE // ACTION
fAddAttach( aCtl[ 12 ] ) ; // descomentar para FWH 8.12 o posterior

REDEFINE GET oGet5 VAR cBody OF oDlg ; // cuerpo
del mensaje
MEMO ;
ID 105 ;
FONT oFont3 ;
UPDATE ;
COLORS CLR_BLUE, CLR_WHITE
oGet5:bKeydown := { |KeyStroke| IIF( KeyStroke==VK_RETURN, ;
(oGet5:cText(cBody
+=CRLF),;
oGet5:GoBottom()),;

oGet5:Paste(KeyStroke) ) }

REDEFINE BTNBMP oBt1 ID 108 ;
OF oDlg ; // buscar anexos
ACTION fAddAttach( oGet4 )

REDEFINE BTNBMP oBt2 ID 106 ; // enviar el
mensaje
OF oDlg ;
FONT oFont2 ;
ACTION ( fSendMail( cTo, cBCC, cSubject, cBody,
cAttach ),;
oGet5:cText(cBody:=SPACE(800)),;
oGet5:Setfocus(),;
oGet5:refresh(), oBt2:refresh() )

REDEFINE BUTTON oBt3 ID 2 ;
OF oDlg ; // Salir sin hacer
nada
FONT oFont2 ;
ACTION oDlg:End()

ACTIVATE DIALOG oDlg CENTERED //;
//VALID ( .T. )

oFont:End()
oFont2:End()
oFont3:End()
* FreeLibrary(hBorland)

Return Nil
*******************************************************************************
*DLL32 FUNCTION BWCCRegister( hInst AS LONG ) AS WORD PASCAL LIB
"SgemBW32.DLL"
*******************************************************************************
//---------------------------------------------------------------------------------------------//

Function fSendMail( cTo, cBCC, cSubject, cBody, cAttach )

Local oCfg, oMsg, oError, nEle, cToken, ;
aAttach := {}, ;
lAuth := IIF(! Empty( cUser ) .and. !
Empty( cPass ), .T., .F.) ,;
nSendOpt := 2 // send using: 1 = pickup folder 2 = port

Default cSubject := "Text de correo con CDO", ;
cBody := "Test de prueba de correo con CDO"

If "GMAIL.COM" $ Upper( cMailServer ) .and. ( Empty( cUser ) .or.
Empty( cPass ) )
MsgStop( "Con GMail son requeridos nombre de usuario y
contraseña", "Atención" )
Return Nil
EndIf

CursorWait()

nEle := 1

While ! Empty( cToken := StrToken( cAttach, nEle++, "," ) )
AAdd( aAttach, cToken )
EndDo


Try
oCfg := CreateObject( "CDO.Configuration" )

With Object oCfg:Fields

:Item( "http://schemas.microsoft.com/cdo/configuration/
smtpserver" ):Value := allTrim( cMailServer )
:Item( "http://schemas.microsoft.com/cdo/configuration/
smtpserverport" ):Value := nPort
:Item( "http://schemas.microsoft.com/cdo/configuration/
sendusing" ):Value := nSendOpt // Remote SMTP = 2, local = 1
/*
:Item( cdoSMTPServer ):Value := allTrim( cMailServer )
:Item( cdoSMTPServerPort ):Value := nPort
:Item( cdoSendUsing ):Value := nSendOpt
*/
MsgInfo(cMailServer+CRLF+str(nPort)+CRLF+Str(nSendOpt))

If lAuth

:Item( "http://schemas.microsoft.com/cdo/configuration/
smtpauthenticate" ):Value := .T.
:Item( "http://schemas.microsoft.com/cdo/configuration/
smtpusessl" ):Value := .T.
:Item( "http://schemas.microsoft.com/cdo/configuration/
sendusername" ):Value := allTrim( cUser )
:Item( "http://schemas.microsoft.com/cdo/configuration/
sendpassword" ):Value := allTrim( cPass )
:Item( "http://schemas.microsoft.com/cdo/configuration/
smtpconnectiontimeout"):Value := 30


/*
:Item( cdoSMTPAuthenticate ):Value := .T. // 1
:Item( cdoSendUserName ):Value := allTrim( cUser )
:Item( cdoSendPassword ):Value := allTrim( cPass )
:Item( cdoSMTPUseSSL ):Value := .T. // 1
:Item( smtpconnectiontimeout ):Value := 30
*/
EndIf



:Update()
End With


oMsg := CreateObject( "CDO.Message" )

With Object oMsg
:Configuration := oCfg
:From := allTrim( cFrom )
:To := allTrim( cTo )
:Subject := allTrim( cSubject )
:TextBody := allTrim( cBody )

MsgInfo(cFrom+CRLF+cTo+CRLF+cSubject+CRLF+cBody)


For nEle := 1 To Len( aAttach )
:AddAttachment(AllTrim( aAttach[ nEle ] ) )
Next

If ! Empty( cBCC )
:BCC := Trim( cBCC )
EndIf

:Send()
End With

Catch oError
CursorArrow()
MsgStop( "Could not send the message" + CRLF + "Error: " +
cValToChar( oError:GenCode) + CRLF + ;
"SubC: " + cValToChar( oError:SubCode ) + CRLF +
"OSCode: " + cValToChar( oError:OsCode ) + CRLF + ;
"SubSystem: " + cValToChar( oError:SubSystem ) + CRLF +
"Message: " + oError:Description )

oCfg := Nil
oMsg := Nil
Return Nil
End Try
MsgInfo("Email Send successfully")

oCfg := Nil
oMsg := Nil
SndPlaySound( GetWinDir() + "\media\Tada.wav", 0 )
CursorArrow()

Return Nil

//---------------------------------------------------------------------------------------------//

Static Function fAddAttach( oGet )

Local cFile, ;
cAttach := oGet:VarGet()

cFile := cGetFile( "*.*", "Selecciona el archivo" )

If ! Empty( cFile )
cAttach := Lower( PadR( AllTrim( cAttach ) + If( !
Empty( cAttach ), ",", "" ) + AllTrim( cFile ), 180 ) )
EndIf

oGet:cText( cAttach )

Return Nil

********************************************************************************
Static Function SetupMail()
LOCAL oDlg, oBt1, oBt2
Local oGet1, oGet2, oGet3, oGet4, oGet5
local oIni
local lOk := .F.
*
local cxMailServer:=ALLTRIM(cMailServer)+REPLICATE(" ",60-
LEN(ALLTRIM(cMailServer)))
local nxPort:=nPort
local cxUser:=ALLTRIM(cUser)+REPLICATE(" ",60-LEN(ALLTRIM(cUser)))
local cxPass:=ALLTRIM(cPass)+REPLICATE(" ",30-LEN(ALLTRIM(cPass)))
local cxFrom:=ALLTRIM(cFrom)+REPLICATE(" ",60-LEN(ALLTRIM(cFrom)))
*
DEFINE DIALOG oDlg RESOURCE "EmailSetup"
REDEFINE GET oGet1 VAR cxMailServer ID 101 OF oDlg
REDEFINE GET oGet2 VAR nxPort ID 102 OF oDlg PICTURE "9999"
REDEFINE GET oGet3 VAR cxUser ID 103 OF oDlg
REDEFINE GET oGet4 VAR cxPass ID 104 OF oDlg
REDEFINE GET oGet5 VAR cxFrom ID 105 OF oDlg

REDEFINE BUTTON oBt1 ID 1 OF oDlg ACTION (lOk := .T.,
oDlg:end() )
REDEFINE BUTTON oBt2 ID 2 OF oDlg ACTION oDlg:end()
ACTIVATE DIALOG oDlg CENTERED

IF lOk
cMailServer :=ALLTRIM(cxMailServer)
nPort :=nxPort
cUser :=ALLTRIM(cxUser)
cPass :=ALLTRIM(cxPass)
cFrom :=ALLTRIM(cxFrom)
*
WriteIni() // escribe los nuevos valores al archivo INI
*
ENDIF

RETURN NIL

procedure AppSys // Xbase++ requirement
return

Static FUNCTION CreaIni()
*
nFileHandle := FCreate( "email.ini", FC_NORMAL )
cText := "[SETUPMAIL]"+CRLF+;
"MailServer = "+"smtp.gmail.com"+CRLF+;
"remitente = "+"apic1...@gmail.com"+CRLF+;
"puerto = "+"465"+CRLF+;
"usuario = "+"apic1...@gmail.com"+CRLF+;
"password = "+"miclave"+CRLF // aqui va mi clave en el
servidor de gmail
FWrite( nFileHandle, cText )
FClose( nFileHandle )
*
RETURN NIL

STATIC FUNCTION ReadIni()
local oIni

INI oIni FILENAME ( "./emailCdo.ini" )
GET cMailServer SECTION 'SETUPMAIL' ENTRY 'MailServer' OF
oIni
GET cFrom SECTION 'SETUPMAIL' ENTRY 'remitente' OF
oIni
GET nPort SECTION 'SETUPMAIL' ENTRY 'puerto' OF
oIni
GET cuser SECTION 'SETUPMAIL' ENTRY 'usuario' OF
oIni
GET cpass SECTION 'SETUPMAIL' ENTRY 'password' OF
oIni
ENDINI

RETURN NIL

Static FUNCTION WriteIni()
local oIni
INI oIni FILENAME ( "./emailCdo.ini" )
SET SECTION "SETUPMAIL" ENTRY 'MailServer' TO cMailServer OF
oIni
SET SECTION "SETUPMAIL" ENTRY 'remitente' TO cFrom OF
oIni
SET SECTION "SETUPMAIL" ENTRY 'puerto' TO nPort OF
oIni
SET SECTION "SETUPMAIL" ENTRY 'usuario' TO cUser OF
oIni
SET SECTION "SETUPMAIL" ENTRY 'password' TO cpass OF
oIni
ENDINI

Return nil
***********************************
> Web:http://groups.google.com/group/harbour-users- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

Gmail

unread,
Jan 19, 2012, 2:44:32 PM1/19/12
to harbou...@googlegroups.com
Hello Lucas,

Thanks for your sample.

Sure:

hb_SendMail( cSERVER , ;
nPORT , ;
cFROM , ;
cTO , ;
cCC, ;
cBCC, ;
cBODY , ;
cSUBJECT , ;
aFILES , ;
cUSER , ;
cPASSWORD , ;
cPOPSERVER , ;
nPRIORITY , ; // PRIORITY 1=HIGH
3=NORMAL 5=LOW
lREAD, ;
bTRACE, ;
lPOPAUTHENTICATION ) // May have more
parameters that I don't use


Example (from Contrib):

------8<------
/*
* $Id: gmail.prg 14688 2010-06-04 13:32:23Z vszakats $
*/

/*
* Copyright 2009 Viktor Szakats (harbour.01 syenar.hu)
* www - http://harbour-project.org
*/

#include "common.ch"
#include "simpleio.ch"

PROCEDURE Main( cFrom, cPassword, cTo )

DEFAULT cFrom TO "<myn...@gmail.com>"
DEFAULT cPassword TO "<mypassword>"
DEFAULT cTo TO "addr...@domain.com"

? hb_SendMail( "smtp.gmail.com",;
465,;
cFrom,;
cTo,;
NIL /* CC */,;
{} /* BCC */,;
"test: body",;
"test: subject",;
NIL /* attachment */,;
cFrom,;
cPassword,;
"",;
NIL /* nPriority */,;
NIL /* lRead */,;
.T. /* lTrace */,;
.F.,;
NIL /* lNoAuth */,;
NIL /* nTimeOut */,;
NIL /* cReplyTo */,;
.T. )

RETURN
------>8------

----- Original Message -----
From: "L." <lucasde...@gmail.com>
To: "Harbour Users" <harbou...@googlegroups.com>
Sent: Thursday, January 19, 2012 17:28
Subject: [harbour-users] Re: best way to Send an Email from Harbour


Hello,

Thanks for helping me.

Do you have a hb_sendmail() sample please?.

Sometomes I got errors with cdo.

This is a working sample:

#include "FiveWin.ch"
*#include "CdoSys.ch"
*#include "FGet.ch"
#include "Fileio.ch"

#define WS_3DLOOK 4
#define CLR_HBROWN nRGB( 205, 192, 176 )
#define CLR_NBLUE nRGB( 142, 171, 194 )
*
STATIC oDlg, oFont, oFont2
STATIC cMailServer,; //:= PadR( "smtp.gmail.com",
60 ), ; // servidor de correo
cFrom ,; //:= PadR( "remi...@gmail.com",
60 ), ; // remitente
nPort ,; //:=
465, ; // puerto usado por el
servidor de correo
cUser ,; //:=
Space( 60 ), ; // nombre de usuario para

autenticaci�n
cPass //:=
Space( 30 ) // contrase�a para
autenticaci�n


STATIC nLine := 1
//--------------------------------------------------------------------------------------------------------------------//

*Function fEmail(cMailServer, cFrom, cnPort, cUser, cPass )

Function fEmail(cTo) // Recibe como par�metro el correo electr�nico
del cliente

oDlg:lHelpIcon := .F.
oDlg:cCaption := "Mensaje Electr�nco para - " // +cNombre

oGet5:Paste(KeyStroke) ) }

contrase�a", "Atenci�n" )

L.

unread,
Jan 19, 2012, 5:34:08 PM1/19/12
to Harbour Users
Thanks but it does not work:

[ 1] = O TIPCLIENTSMTP
[ 2] = C smtps

Stack Calls
===========
Called from: hbtip\client.prg => TIPCLIENT:NEW( 0 )
Called from: hbtip\smtpcli.prg => TIPCLIENTSMTP:NEW( 0 )
Called from: hbtip\sendmail.prg => HB_SENDMAIL( 0 )
Called from: demo.prg => MAIN( 54 )



On 19 ene, 20:44, "Gmail" <wanstad...@gmail.com> wrote:
> Hello Lucas,
>
>  * www -http://harbour-project.org
>  */
>
> #include "common.ch"
> #include "simpleio.ch"
>
> PROCEDURE Main( cFrom, cPassword, cTo )
>
>    DEFAULT cFrom     TO "<myn...@gmail.com>"
>    DEFAULT cPassword TO "<mypassword>"
>    DEFAULT cTo       TO "addres...@domain.com"
>        cFrom      ,;   //:= PadR( "remite...@gmail.com",
> 60 ), ;        // remitente
>        nPort      ,;   //:=
> 465, ;                                      // puerto usado por el
> servidor de correo
>        cUser      ,;   //:=
> Space( 60 ), ;                              // nombre de usuario para
> autenticaci n
>        cPass           //:=
> Space( 30 )                                 // contrase a para
> autenticaci n
> STATIC nLine := 1
> //-------------------------------------------------------------------------­-------------------------------------------//
> ***************************************************************************­****
> *DLL32 FUNCTION BWCCRegister( hInst AS LONG ) AS WORD PASCAL LIB
> "SgemBW32.DLL"
> ***************************************************************************­****
> //-------------------------------------------------------------------------­--------------------//
> ...
>
> leer más »- Ocultar texto de la cita -

Gmail

unread,
Jan 19, 2012, 5:37:45 PM1/19/12
to harbou...@googlegroups.com
Can you please show line 54 of your demo.prg?
There is an incompatible type there.

Qatan

> leer m�s �- Ocultar texto de la cita -


>
> - Mostrar texto de la cita -

--

L.

unread,
Jan 20, 2012, 3:30:07 AM1/20/12
to Harbour Users
Hello,

This is my demo.prg

Use Harbour 3.1, BCC 5.8.2 and FW 11.01:





/*
hb_SendMail( cSERVER , ;
nPORT , ;
cFROM , ;
cTO , ;
cCC, ;
cBCC, ;
cBODY , ;
cSUBJECT , ;
aFILES , ;
cUSER , ;
cPASSWORD , ;
cPOPSERVER , ;
nPRIORITY , ; // PRIORITY
1=HIGH
3=NORMAL 5=LOW
lREAD, ;
bTRACE, ;
lPOPAUTHENTICATION ) //

*/


#include "common.ch"
#include "simpleio.ch"

PROCEDURE Main( cFrom, cPassword, cTo )

DEFAULT cFrom TO "<myn...@gmail.com>"
DEFAULT cPassword TO "<mypassword>"
DEFAULT cTo TO "addr...@domain.com"

? hb_SendMail( "smtp.gmail.com",;
465,;
cFrom,;
cTo,;
NIL /* CC */,;
{} /* BCC */,;
"test: body",;
"test: subject",;
NIL /* attachment */,;
cFrom,;
cPassword,;
"",;
NIL /* nPriority */,;
NIL /* lRead */,;
.T. /* lTrace */,;
.F.,;
NIL /* lNoAuth */,;
NIL /* nTimeOut */,;
NIL /* cReplyTo */,;
.T. )

RETURN NIL
> Web:http://groups.google.com/group/harbour-users- Ocultar texto de la cita -

Klas Engwall

unread,
Jan 20, 2012, 9:16:58 AM1/20/12
to harbou...@googlegroups.com
Hi Qatan,

> Can you please show line 54 of your demo.prg?
> There is an incompatible type there.

It looks more like this error is generated by the oErr := ErrorNew()
call in line 210 (or thereabout) in client.prg. And if so, it is caused
by the requested protocol "smtps" not being supported. The code at the
beginning of the New() method of the tIPClient class before the line I
mentioned explains it.

If that is what happens, then what looks like an incompatible type in
the error message is just the result of what follows in line 211:

oErr:Args := { Self, oURL:cProto }

Regards,
Klas

Gmail

unread,
Jan 20, 2012, 11:20:09 AM1/20/12
to harbou...@googlegroups.com
Hello Klas,

Seems that you are right.
Thanks for helping.

Qatan

Gmail

unread,
Jan 20, 2012, 11:56:57 AM1/20/12
to harbou...@googlegroups.com
Hello Lucas,

I recommend you to test it with real data.

f.e.: "<myn...@gmail.com>" should be swiched to your email address:
"kycasde...@gmail.com" (without "<" and ">" ) and so on.
I belive it will work.

L.

unread,
Jan 20, 2012, 3:06:44 PM1/20/12
to Harbour Users
Hello,

I tested with real data but does not work.

If i set lPOPAUTHENTICATION to .F. the error does not show up but
does not send the message.

What C compiler do you use?.

Can you please test with BCC 5.8.2?.

Thanks again!.

On 20 ene, 17:56, "Gmail" <wanstad...@gmail.com> wrote:
> Hello Lucas,
>
>     I recommend you to test it with real data.
>
>     f.e.: "<myn...@gmail.com>" should be swiched to your email address:
> "kycasdebelt...@gmail.com" (without "<" and ">" ) and so on.
> ...
>
> leer más »

Gmail

unread,
Jan 21, 2012, 10:27:15 PM1/21/12
to harbou...@googlegroups.com
Hello Lucas,

Here I use hb_sendmail() compiled with MingW and BCC 5.51 without
problems.
Sorry but I do not have BCC 5.8.2 right now to test but theoretically it
does not make any difference in this case since BCC 5.51 works for the test.
Probably it is account comfit problems. Did you try with other
configurations or other accounts (f.e. not gmail)?
I hope it will help you.
Regards,

Qatan


Hello,

Thanks again!.

> leer m�s �

Bernard Mouille

unread,
Jan 22, 2012, 5:09:32 AM1/22/12
to Harbour Users

Hello all,

Thanks for your help.

Is it possible with hb_SendMail() to send a html eMail ?

Bernard

Alex Strickland

unread,
Jan 22, 2012, 5:18:41 AM1/22/12
to harbou...@googlegroups.com
On 2012/01/19 08:22 PM, L. wrote:

> Which is the best way to send an email from Harbour?.

I don't use it myself, but my understanding is that CURL is the best way
to send email from Harbour.

--
Alex

Gmail

unread,
Jan 22, 2012, 8:19:48 AM1/22/12
to harbou...@googlegroups.com
Hello Bernard,

Yes, I tested it and works well to send html email.

Qatan

----- Original Message -----
From: "Bernard Mouille" <bernard...@wanadoo.fr>
To: "Harbour Users" <harbou...@googlegroups.com>
Sent: Sunday, January 22, 2012 08:09
Subject: [harbour-users] Re: best way to Send an Email from Harbour


>

Gmail

unread,
Jan 22, 2012, 8:23:01 AM1/22/12
to harbou...@googlegroups.com
Hello Alex,

I would like to test CURL on day because I also heard that is very good
but my little experience is that it is not that easy to set up.
I tried once and got stuck (I do not remember what was the problem) and
I didn't go ahead because I didn't have time but I want to try again and
hb_sendmail() was doing the job.

Qatan

Bernard Mouille

unread,
Jan 22, 2012, 9:08:34 AM1/22/12
to Harbour Users
Hello Qatan,

Thank you, I have find that I must fo put a file.html in the Body

Bernard

Viktor Szakáts

unread,
Jan 22, 2012, 9:45:17 AM1/22/12
to harbou...@googlegroups.com
> I don't use it myself, but my understanding is that CURL is the best way 
> to send email from Harbour.

I can second that. This method still relies on HBTIP to 
create the message content, and uses HBCURL to 
send it through the wire.

Viktor

Reply all
Reply to author
Forward
0 new messages