CDOsys sending email

HMG en Español

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2359
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 434 times
Been thanked: 84 times
Contact:

CDOsys sending email

Post by danielmaximiliano »

Hola a todos :
hace tiempo habia publicado la forma de utilizar CDOSYS para el envio de correos

recuerden que a veces es necesario modificar los parametros de Yahoo dado que tiene servidores SMTP distintos para cada region, no sucediendo eso para otros ejemplo : Gmail y Hotmail.

recuerden tambien que es necesario modificar la cuenta en Gmail y Outlook.com y Yahoo para que puedan acceder desde aplicaciones que usan POP3 y SMTP y de esta forma ampliar la lectura y envio de email que no sea desde WebMail

Translate Google
Hello everyone:
had published a while how to use CDOSYS for sending emails

remember that sometimes it is necessary to modify the parameters of Yahoo since each region has different SMTP servers, so not happening for other example: Gmail and Hotmail.

Also remember that you need to modify the account in Gmail and Yahoo Outlook.com and so they can be accessed from applications that use POP3 and SMTP and thus expand the Reading and sending email is not from WebMail

http://windows.microsoft.com/en-us/wind ... e-from-app
https://mail.google.com/mail/#settings/general
CDOsys sendeer.jpg
CDOsys sendeer.jpg (84.38 KiB) Viewed 5985 times
yahoo ok.jpg
yahoo ok.jpg (66.19 KiB) Viewed 5985 times
Last edited by danielmaximiliano on Mon Apr 07, 2014 11:15 pm, edited 1 time in total.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar »

Hola danielmaximiliano,

Gracias por compartir, en la semana lo pruebo!

Saludos

User avatar
danielmaximiliano
Posts: 2359
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 434 times
Been thanked: 84 times
Contact:

Post by danielmaximiliano »

Hi :


How to modify CDOSYS to attach the HTML message body
Attachments
CDOsys.rar
(46.43 KiB) Downloaded 360 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar »

Gracias DanielMaximiliano por compartir!

Saludos

User avatar
danielmaximiliano
Posts: 2359
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 434 times
Been thanked: 84 times
Contact:

Post by danielmaximiliano »

Correct code .

Code: Select all

WITH OBJECT loMsg
		 :Configuration := loCfg
         :From          := Main.cFrom.Value
         :To            := Main.cTo.Value
         :Subject       := "e-Mail test using <<< CDOSYS (Collaboration Data Objects) >>>"
         :TextBody      := Main.Contenido.Value
		 //TODO: To send HTML body, uncomment the following lines:
				//cHtml := "<HTML>\n"                                                      + ;
				//	"<HEAD>\n"                                                             + ;
				//	"<TITLE>Sample GIF</TITLE>\n"                                 + ;
				//	"</HEAD>\n"                                                            + ;
				//	"<BODY><P>\n"                                                        + ;
				//	"<h1><Font Color=Green>Inline graphics</Font></h1>\n" + ;
				//	"</BODY>\n"                                                            + ;
				//	"</HTML>" 
				//:TextBody := cHtml 
				
				//TODO: To send WEb page in an e-mail, uncomment the following lines and make changes in TODO section.
				//TODO: Replace with your preferred Web page
				//:CreateMHTMLBody("http://www.microsoft.com"  , ;
				//	CDO.CdoMHTMLFlags.cdoSuppressNone        ,  ; 
				//	"", "" )
				//:Subject = "Test SMTP"
				
		 If Main.archivos.ItemCount > 0
            For k:=1 to Main.archivos.ItemCount
               :AddAttachment(Main.archivos.Item(k))
            Next k
		 Endif
		 
         :Send()
      ENDWITH
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
serge_girard
Posts: 2577
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 865 times
Been thanked: 161 times
Contact:

Post by serge_girard »

Hi Danile,

Thx for sharing!


Serge

User avatar
danielmaximiliano
Posts: 2359
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 434 times
Been thanked: 84 times
Contact:

Post by danielmaximiliano »

Thank Serge

I made a new version Html to include as part of the email body.

http://hmgforum.com/viewtopic.php?p=33416#p33416

Error correction for opening html file.

Code: Select all

/***********************************************************************/ 
  Function AttachHtml()
/***********************************************************************/
Local ForReading := 1, ForWriting := 2, ForAppending := 8
Local oHtml , oBody

oHtml = CreateObject( "Scripting.FileSystemObject" )
//'Open the file for reading
 if (oHtml:FileExists( "Demo.htm" ) )
    oBody = oHtml:OpenTextFile( "Demo.htm" , ForReading )
    //The ReadAll method reads the entire file into the variable BodyText
    cHtmlBody = oBody:ReadAll
	 Msginfo(" the file Demo.htm was added " , "Attention message" )
 Else
    Msginfo("Demo.htm not exist in the specified path" , "Attention Message" )
 Endif

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
serge_girard
Posts: 2577
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 865 times
Been thanked: 161 times
Contact:

Post by serge_girard »

Daniel,


Just had time to try sending email but I get following error:

Could not send the message
Error:1
SubC: 1007
OSCode : -2147352567
SubS WINOLE
Description: Transportfunction cannot make connection to server.

When I try with hb_sendmail it works but I don't think it work with content-type HTML?

Any idea what is wrong?

Greetings, Serge

User avatar
danielmaximiliano
Posts: 2359
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 434 times
Been thanked: 84 times
Contact:

Post by danielmaximiliano »

Sorry everyone here on the forum, I missed this topic since those days and possibly not abi browser and past few days I have to read new topics.

el amigo Eduardo Luis me comento mediante email que no funcionaba CDOSYS y si hubo cambios ...

Luis no me di cuenta si hubo cambio en esta fechas en CDOSYS, hubo muchos parches para windows pero no creo que toquen esta dll ya que funciona perfectamente..
lo que note que posiblemente haya yo hecho cambios en el ajuste de configuracion de CDOSYS y no me haya dado cuenta y subo algo que ya habia corregido hace mucho tiempo..

subo de nuevo el proyecto para HMG.3.4.0 probado y funcionando en mi Windows 7 home premium 64 compilado en 32 bits.

Translate Google

Luis Eduardo friend told me via email that did not work CDOSYS and if there were changes ...

Luis did not notice if there was a change in the dates CDOSYS, there were many patches for windows but I do not touch this dll and it works perfectly ..
which note that there may be changes made in adjusting settings CDOSYS and has not realized and upload something that had already corrected a long time ago ..

again upload the project to HMG.3.4.0 tested and running on my Windows 7 home premium 64 compiled in 32 bits.
CDOSYS.jpg
CDOSYS.jpg (84.54 KiB) Viewed 5094 times
CDOsys.rar
(118.93 KiB) Downloaded 298 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

User avatar
danielmaximiliano
Posts: 2359
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 434 times
Been thanked: 84 times
Contact:

Post by danielmaximiliano »

posiblemente tengan problemas con Gmail dado que tiene nuevas politicas de seguidad..
entren y vefifiquen de bajar el nivel de seguridad para aplicaciones externas a Gmail.. Translate Google possibly having problems with Gmail since it has new policies seguidad ..
come down and check the security level for external applications to Gmail .

https://security.google.com/settings/se ... vity?pli=1

or

https://www.google.com/settings/security/lesssecureapps
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

Post Reply