email CDO caracter problem

email CDO caracter problem

Postby Wanderson » Wed May 25, 2016 1:07 am

Hi,

I work with cdo to send e-mails but in email body i need to display special caracter like ç ã ó é etc.
If I select this sentence:

Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva.

In destination email body display this:

Segue convoca��o para assembleia geral extraordin�ria tendo como pauta negocia��o da conven��o coletiva.

How I can fix this?

Thanks in advance.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: email CDO caracter problem

Postby Enrico Maria Giordano » Wed May 25, 2016 9:40 am

Wanderson wrote:Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva.


I just try with your above sample and it worked perfect here.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: email CDO caracter problem

Postby vilian » Wed May 25, 2016 10:51 am

I have the same problem.
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: email CDO caracter problem

Postby Enrico Maria Giordano » Wed May 25, 2016 10:56 am

Can I see a reduced and self-contained sample of the problem?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: email CDO caracter problem

Postby Wanderson » Wed May 25, 2016 12:24 pm

Enrico Maria Giordano wrote:Can I see a reduced and self-contained sample of the problem?

EMG


Enrico above you can see how i send mails, but in destination body email the caracters display wrong. Thanks!

Static Function Config_Mail()

local lRet := .f.
local oCfg, oError
local cServ := "smtp.gmail.com"
local nPort := "465"
local lAut := .t.
local lSSL := .t.
local cUser := "blablabla"
local cRemt := "blablabla@gmail.com"
local cDest := "blablabla@gmail.com"
local cPass := "blablabla"
local cSubject := "test"
local cCC := ""
local cCCO := ""
local cAttach := {}
local cTxt := "Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva."

TRY
oCfg := CREATEOBJECT( "CDO.Configuration" )
WITH OBJECT oCfg:Fields
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ):Value := cServ
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ):Value := nPort
:Item( "http://schemas.microsoft.com/cdo/configuration/sendusing" ):Value := 2
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ):Value := lAut
:Item( "http://schemas.microsoft.com/cdo/configuration/smtpusessl" ):Value := lSSL
:Item( "http://schemas.microsoft.com/cdo/configuration/sendusername" ):Value := cUser
:Item( "http://schemas.microsoft.com/cdo/configuration/sendpassword" ):Value := cPass
:Update()
END WITH
lRet := .t.
CATCH oError
MsgInfo( "Não Foi possível Enviar o e-Mail!" +CRLF+ ;
"Error: " + Transform(oError:GenCode, nil) + ";" +CRLF+ ;
"SubC: " + Transform(oError:SubCode, nil) + ";" +CRLF+ ;
"OSCode: " + Transform(oError:OsCode, nil) + ";" +CRLF+ ;
"SubSystem: " + Transform(oError:SubSystem, nil) + ";" +CRLF+ ;
"Mensaje: " + oError:Description, "Atenção" )
lRet := .f.
END


if lRet
lRet := Envia_Mail(oCfg,cRemt,cDest, cCC, cCCO, cTxt, cSubject, cAttach)
endif

Return lRet

********************************************************************************
Static Function Envia_Mail(oCfg,cFrom, cTo, cCC, cBCC, cMsg, cSubject, cAttach)

local cToken
local lRet := .f.
local Vezes := 0

Do While Vezes <= 5

cTo := Destinatarios( cTo ) //--> PARA
cCC := Destinatarios( cCC ) //--> COM COPIA
cBCC := Destinatarios( cBCC ) //--> COM COPIA OCULTA

TRY
oMsg := CREATEOBJECT ( "CDO.Message" )
WITH OBJECT oMsg
:Configuration = oCfg
:From = cFrom
:To = cTo
:CC = cCC
:BCC = cBCC

:Subject = cSubject
:TextBody = cMsg
For x2 := 1 To Len( cAttach )
if cAttach[x2] <> NIL
:AddAttachment(cAttach[x2])
endif
Next
:Send()
END WITH
lRet := .t.
CATCH
lRet := .f.
++Vezes
loop
END
Exit
Enddo
Return lRet
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: email CDO caracter problem

Postby karinha » Wed May 25, 2016 12:38 pm

Code: Select all  Expand view

local cTxt := OemToAnsi( "Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva." )
 


.or.

Code: Select all  Expand view

local cTxt := AnsiToOem( "Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva." )
 


Regards
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: email CDO caracter problem

Postby Wanderson » Wed May 25, 2016 12:50 pm

karinha wrote:
Code: Select all  Expand view

local cTxt := OemToAnsi( "Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva." )
 


.or.

Code: Select all  Expand view

local cTxt := AnsiToOem( "Segue convocação para assembleia geral extraordinária tendo como pauta negociação da convenção coletiva." )
 


Regards


Já tentei karinha mas sem resultado. Obrigado.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: email CDO caracter problem

Postby karinha » Wed May 25, 2016 1:05 pm

xHarbour, normal:

Image
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: email CDO caracter problem

Postby Wanderson » Wed May 25, 2016 1:09 pm

karinha wrote:xHarbour, normal:

Image


karinha, mostrando com um alert fica normal sim. Mas após enviar o email com esse texto no corpo o destinatário quando abre, aparece caracteres trocados por causa do cedilha e acentos. Valeu!
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: email CDO caracter problem

Postby Enrico Maria Giordano » Wed May 25, 2016 1:41 pm

karinha wrote:xHarbour, normal:

Image


I'm using xHarbour.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: email CDO caracter problem

Postby karinha » Wed May 25, 2016 2:07 pm

Wanderson, usando o meu RMAIL.PRG está normal. Veja - mira - look:

Image

Saludos, regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: email CDO caracter problem

Postby karinha » Wed May 25, 2016 2:09 pm

Wanderson, in Windows Live Mail:

Image

Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: email CDO caracter problem

Postby Wanderson » Wed May 25, 2016 2:13 pm

karinha wrote:Wanderson, usando o meu RMAIL.PRG está normal. Veja - mira - look:

Image

Saludos, regards.


Karinha, pode disponibilizar? Obrigado!
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: email CDO caracter problem

Postby karinha » Wed May 25, 2016 2:25 pm

Infelizmente esta versão eu não posso Wanderson, pois é personalizada da Empresa.

Mas você pode baixar a Original do Ricardo Marques, aqui:

http://www.4shared.com/zip/9wQ0A3UHce/RMAIL.html
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 76 guests