CDOsys sending email

HMG en Español

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2357
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 433 times
Been thanked: 83 times
Contact:

Re: CDOsys sending email

Post by danielmaximiliano »

Hola Mustafá:
estaba haciendo un ejemplo similar ya que ":CreateMHTMLBody("File://C:\CDOsys\PickUp\sample.html",0) " contiene los TAG
<html>
</html>
al utilizar cualquier otra operacion HTML las imagenes incrustadas pasan a ser archivos adjuntos
mi codigo esta algo similar a estoque por falta de tiempo no pude completar

Code: Select all

Function CreateHTML()
    cNameHTML := "Demo.htm"
         IF FILE( cNameHTML )
             FERASE( cNameHTML )
         ENDIF
	msgbox ( cNameHTML )	 
   nHandle := FCREATE( cNameHTML, FC_NORMAL )

   FWRITE( nHandle, "<HTML>" +  CRLF )
   FWRITE( nHandle, "<HEAD>" +  CRLF )
   FWRITE( nHandle, "<TITLE>Body Email With HMTL documment</TITLE>" +  CRLF )
   FWRITE( nHandle, "</HEAD>" +  CRLF )
   FWRITE( nHandle, "<BODY BGCOLOR=FFFFFF>" +  CRLF )
   FWRITE( nHandle, "<CENTER><IMG SRC=hmg.jpg ALIGN=BOTTOM> </CENTER>" +  CRLF )
   FWRITE( nHandle, "<DIV><FONT face=Verdana size=4><STRONG>EMBED PICTURES SAMPLE WITH CDOSYS</STRONG></FONT></DIV>" +  CRLF )
   FWRITE( nHandle, "<P></P><P></P>" +  CRLF )

Return 

/***************************************************************************************************/
Function CreateBody()

   msgbox( cNameHTML )

FWRITE( nHandle, "<DIV><IMG src=" + GetStartUpFolder() + "\logo1.jpg" + "></DIV>" +;
                 "<DIV><FONT face=Verdana size=2>Image" + ;
                 "<<lcJustFnamePictFile>></FONT></DIV>"+  CRLF )
FWRITE( nHandle, "<P></P><P></P><div></div><div></div>"+  CRLF )

Return 

/***************************************************************************************************/
Function CloseHtml()
  FWRITE( nHandle, "</BODY>" +  CRLF )
  FWRITE( nHandle, "</HTML>" +  CRLF )
  FCLOSE( nHandle )
Return 
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
mustafa
Posts: 1008
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 208 times
Contact:

Post by mustafa »

Hola Daniel:
Muy agradecido por la rapida contestación
sigo investigando.
Saludos /Regards
Mustafa

User avatar
mustafa
Posts: 1008
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 208 times
Contact:

Post by mustafa »

Hola amigos:

Dejo un Sample basado en el magnífico trabajo
aportado por DaNiElMaXiMiLiAnO con su Sample
CDOsys de envío de Correo.

Me propuse crear un fichero HTML con un Logo
e incrustarlo en el cuerpo del eMail (color de
fondo, elección tipo de letra, color letra, etc )
No como un > Attached <

El objetivo lo he conseguido a medias ...
Funciona desde el Sample a ==> Gmail --OK!!-- :lol:

Pero desde ==> Outlook no está saliendo
correcto y tampoco desde el Sample a ==> Yahoo :(

Ver Carpeta Help_Config ==>"Screenshot.jpg"
ver también en misma carpeta "Readme.txt"
Ver Errores ?

Bueno amigos espero que sea de su agrado

Un Saludo

Mustafa


*---------- Google Translator --------------+
Hello friends:

I leave a Sample based on the magnificent work
provided by DaNiElMaXiMiLiAnO with its Sample
Mail shipping CDOsys.

I decided to create an HTML file with a Logo
and embed it in the body of the eMail (color of
background, font choice, font color, etc )
Not as an > Attached <

I have half achieved the goal ...
Works from Sample to ==> Gmail --OK !! - :lol:

But since ==> Outlook is not exiting
correct and neither from the Sample a ==> Yahoo! :(

See Help_Config Folder ==> "Screenshot.jpg"
see also in the same folder "Readme.txt"
View Errors ?

Well friends I hope you like it

Regards

Mustafa
Attachments
Mail_CDOsys_2020.zip
(1.41 MiB) Downloaded 17 times
screenshot.jpg
screenshot.jpg (109.52 KiB) Viewed 325 times

User avatar
AUGE_OHR
Posts: 1071
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 185 times
Been thanked: 296 times

Post by AUGE_OHR »

hi

i do use CDO too but as i know Support will end.
so i switch to hbTip()
have fun
Jimmy

User avatar
mol
Posts: 3408
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 172 times
Contact:

Post by mol »

AUGE_OHR wrote:
Fri Oct 16, 2020 3:31 pm
hi

i do use CDO too but as i know Support will end.
so i switch to hbTip()
When does it finish?

User avatar
AUGE_OHR
Posts: 1071
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 185 times
Been thanked: 296 times

Post by AUGE_OHR »

mol wrote:
Fri Oct 16, 2020 3:33 pm
When does it finish?
CDO was design for Exchange Server but the have a new Interface.
i have to search for the Info but as i remember next Exchange Version does not support "old" CDO any more.

it is true that you still can use it when have DLL but you have to install them manual when not "build-in"
have fun
Jimmy

User avatar
mol
Posts: 3408
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 268 times
Been thanked: 172 times
Contact:

Post by mol »

I had some problems with hbtip few years ago.
I'll do new tests in this case

User avatar
mustafa
Posts: 1008
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 208 times
Contact:

Post by mustafa »

Hola amigos:

Creo que he podido resolver el problema
que no se veian imagenes incrustada en HTML
mediante Outlook a Gmail.

He utilizado en:
==> "cid: = (CONTENT-ID)" que consiste en crear
en el Logo con el mismo nombre en Attached
pero que nuestra imagen queda oculta.

Code: Select all


Código:

   XUBICA := c:\Mail_CDOsys_2020\Logos_Html\Logo_1.jpg   <== ( por ejemplo, donde esta el Logo  )

  attachment := oMail:Attachments:Add(XUBICA)
  attachment:PropertyAccessor:SetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F", XUBICA )  
       
        oMail:HTMLBody := '<!DOCTYPE HTML>'+  CRLF + ; 
                          '<HTML><BODY>'   +  CRLF + ; 
                          '<BODY style="background-color:'+ ALLTRIM( xTipxF) +';">'  + CRLF +   ;
                          '<br><div ALIGN='+ ALLTRIM(XALIGN) +'>' + ;
            ==>           '<IMG SRC='+'"'+'cid:'+ XUBICA + '"'+  ' id='+"1"  +  ;     .... etc.etc. 

PD: En Yahoo no está Funcionando, solo en Gmail y
de Outlook a Gmail


Espero que les guste :lol:

Saludos
Mustafa

******************** Geoogles Translator *****************

Hello friends:

I think I have been able to solve the problem
that embedded images were not seen in HTML
via Outlook to Gmail.

I have used in:
==> "cid: = (CONTENT-ID)" which consists of creating
in the Logo with the same name in Attached
but that our image is hidden.

Code: Select all

Code:

   XUBICA := c:\Mail_CDOsys_2020\Logos_Html\Logo_1.jpg        <== (for example where is the Logo )

  attachment: = oMail: Attachments: Add (XUBICA)
   attachment: PropertyAccessor: SetProperty ("http://schemas.microsoft.com/mapi/proptag/0x3712001F", XUBICA)
       
           oMail:HTMLBody := '<!DOCTYPE HTML>'+  CRLF + ; 
                          '<HTML><BODY>'   +  CRLF + ; 
                          '<BODY style="background-color:'+ ALLTRIM( xTipxF) +';">'  + CRLF +   ;
                          '<br><div ALIGN='+ ALLTRIM(XALIGN) +'>' + ;
            ==>           '<IMG SRC='+'"'+'cid:'+ XUBICA + '"'+  ' id='+"1"  +  ;     .... etc.etc. 

PS: In Yahoo it is not working, only in Gmail and
from Outlook to Gmail

Hope you like :lol:

Greetings
Mustafa
Attachments
Mail_CDOsys_2020.zip
(1.76 MiB) Downloaded 16 times

Post Reply