cobasystems EMAIL via AutoIt

This forum is for eXpress++ general support.
Message
Author
User avatar
cobasystems
Posts: 15
Joined: Wed Nov 12, 2014 4:44 pm

cobasystems EMAIL via AutoIt

#1 Post by cobasystems »

Alaska Xbase ++ and eXpress ++ version 1.9 library Asinet have an email client that supports SSL encryption. This support has been introduced only in version 2.0 or version 1.9 users do not have it. For this reason, work with version 1.9 used in a variety of solutions, and the most commonly used ActiveX Controls.

I am here used the Windows CDO CDOSYS.DLL ActiveX control that urge from EXE program eMailAutoit.exe written in free Windows script language AutoIt. Complete project and source code for autoit program eMailAutoit.exe I gave in the file:
Alaska Xbase++ EMAIL autoit.zip

https://onedrive.live.com/redir.aspx?ci ... J3Rk2dc3Kw

In this file is located and AutoIt program, and the story of AutoIt program and instructions for working with Autoit tool, and an explanation as to why I believe that programs directly related to the Windows API to write from Autoit Windows script languages.

Its operation is as follows:
SENDING MAIL


Xbase ++ / eXpress ++ application make data and text for mail and all recorded in a plain text file EMAIL.TXT
Then Xbase ++ / eXpress ++ application calls the external program eMailAutoit.exe which loads data from a text file EMAIL.TXT and send them as a mail recipient.

SETTING MAIL SERVER

Xbase ++ / eXpress ++ application calls the external program eMailAutoitConfig.exe which open dialogue for data entry:
- the name of the SMTP mail server,
- port number,
- mail address of the sender
- mail address of the sender to which it sends copies of sent mail,
- username for the mail server
- password for the mail server
- SSL connection Yes / No
The registered information enroll in the Windows registry database.

When Xbase ++ / eXpress ++ application calls the external program eMailAutoit.exe he loaded the data from the Windows registry and uses them to send mail to the recipient. If this information is incorrect mail will be sent.
Complete project and source code for Xbase ++ / eXpress ++ program with eMailAutoit.exe I gave in the file:
Alaska Xbase++ EMAIL via autoit.zip

https://onedrive.live.com/redir.aspx?ci ... 392Bp7K4pY

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: cobasystems EMAIL via AutoIt

#2 Post by Auge_Ohr »

hi,

ZIP File need Password ???

i wonder why you use AutoIt for CDO while you can use it direct with Xbase++

Code: Select all

#include "Gra.ch"
#include "Xbp.ch"
#include "Common.ch"
#include "os.ch"
#pragma library( "ascom10.lib" )

PROCEDURE MAIN
LOCAL oCdoMessage
LOCAL oCdoConf
LOCAL cFromTo 

   oCdoMessage := CreateObject("CDO.Message")
   oCdoConf    := CreateObject("CDO.Configuration")

   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/sendusing",2)

// this is for "WEB.DE"
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.web.de")
// Port 25 or 587 or other depend on Provider  
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
*  oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587)
// SSL
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpusessl", 1)

   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/sendusername", "USERNAME")
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/sendpassword", "USERPASSWORD")

   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60)
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)

   oCdoConf:fields:callMethod("Update")

   oCdoMessage:Configuration := oCdoConf
   oCdoMessage:Subject := "CDO Beispiel"

// send FROM -> TO
   oCdoMessage:setproperty("From", "XXX@web.de")
   oCdoMessage:setproperty("To", "ZZZ@T-ONLINE.de")
   oCdoMessage:TextBody := "von WEB.DE Bla bla bla. "+OS(OS_VERSION)

   oCdoMessage:Send()

WAIT

RETURN
greetings by OHR
Jimmy

User avatar
cobasystems
Posts: 15
Joined: Wed Nov 12, 2014 4:44 pm

Re: cobasystems EMAIL via AutoIt

#3 Post by cobasystems »

password for all my zip files is: cobasystems

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: cobasystems EMAIL via CDO

#4 Post by skiman »

Hi,

I was trying to use the below code, but it doesn't work. Anyone who is using the CDOsys.dll for sending emails? It looks easy, but apparently it isn't.

The error is: the transport failed to connect to the server. I checked Google, and it seems that this is something rather common. It looks as there is never a real concrete answer to this. Same code is working on different PC's and on some it doesn't.

Is there someone who is successfully using CDO for sending mail?
Auge_Ohr wrote:hi,

i wonder why you use AutoIt for CDO while you can use it direct with Xbase++

Code: Select all

#include "Gra.ch"
#include "Xbp.ch"
#include "Common.ch"
#include "os.ch"
#pragma library( "ascom10.lib" )

PROCEDURE MAIN
LOCAL oCdoMessage
LOCAL oCdoConf
LOCAL cFromTo 

   oCdoMessage := CreateObject("CDO.Message")
   oCdoConf    := CreateObject("CDO.Configuration")

   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/sendusing",2)

// this is for "WEB.DE"
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.web.de")
// Port 25 or 587 or other depend on Provider  
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
*  oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587)
// SSL
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpusessl", 1)

   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/sendusername", "USERNAME")
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/sendpassword", "USERPASSWORD")

   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60)
   oCdoConf:fields:setproperty("item","http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)

   oCdoConf:fields:callMethod("Update")

   oCdoMessage:Configuration := oCdoConf
   oCdoMessage:Subject := "CDO Beispiel"

// send FROM -> TO
   oCdoMessage:setproperty("From", "XXX@web.de")
   oCdoMessage:setproperty("To", "ZZZ@T-ONLINE.de")
   oCdoMessage:TextBody := "von WEB.DE Bla bla bla. "+OS(OS_VERSION)

   oCdoMessage:Send()

WAIT

RETURN
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: cobasystems EMAIL via CDO

#5 Post by Auge_Ohr »

skiman wrote:I was trying to use the below code, but it doesn't work.
i use it every Day

you have to find out which Port your Provider need. it might be 578 for SSL but NOT 25
skiman wrote:Anyone who is using the CDOsys.dll for sending emails? It looks easy, but apparently it isn't.
you do not need any DLL ... it is Windows itself who have CDO.
greetings by OHR
Jimmy

Victorio
Posts: 621
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: cobasystems EMAIL via AutoIt

#6 Post by Victorio »

Jimmy,
It is very important, is this possible also for sending attach files in mails ?
And works with Foundation version of Alaska Xbase++ ?

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: cobasystems EMAIL via AutoIt

#7 Post by Auge_Ohr »

Victorio wrote:It is very important, is this possible also for sending attach files in mails ?
YES

Code: Select all

   oCdoAdd := oCdoMessage:AddAttachment("D:\TEST\Test.DOC")
   oCdoAdd:ContentMediaType := "application/msword"
Victorio wrote:And works with Foundation version of Alaska Xbase++ ?
it is Windows so it work with every Programming Language which can use COM / activeX Interface
greetings by OHR
Jimmy

Victorio
Posts: 621
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: cobasystems EMAIL via AutoIt

#8 Post by Victorio »

Superr, I must try it tnx

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: cobasystems EMAIL via CDO

#9 Post by skiman »

Auge_Ohr wrote:
skiman wrote:I was trying to use the below code, but it doesn't work.
i use it every Day

you have to find out which Port your Provider need. it might be 578 for SSL but NOT 25
skiman wrote:Anyone who is using the CDOsys.dll for sending emails? It looks easy, but apparently it isn't.
you do not need any DLL ... it is Windows itself who have CDO.
Hi Jimmy,

If I test the port I use with xbsee library with portqry it is 'listening'. I'm using port 578, which is working with xbsee.

I tested now with port 25, and the mail was send.

Both tests have been done with the same .EXE, to be sure that my application isn't blocked by some software.

Apparently it is a port issue. I will give the option in my application, mail by CDO or mail by xbsee.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: cobasystems EMAIL via AutoIt

#10 Post by rdonnay »

When I use Chilkat_9_5_0.Mailman ActiveX for smtp I use port 465 for Gmail.

Also, Chilkat has a logical value that must be set to enable SSL:

Code: Select all

oMailman := CreateObject('Chilkat_9_5_0.MailMan')

*  Any string argument automatically begins the 30-day trial.
nSuccess := oMailman:UnlockComponent("30-day trial")
IF (nSuccess <> 1)
  DCMSGBOX oMailman:LastErrorText
  QUIT
ENDIF

*  Set the SMTP server.
oMailman:SmtpHost = "smtp.gmail.com"

oMailman:SmtpUsername := ''
oMailman:SmtpPassword := ''

oMailman:SmtpSsl := 1
oMailman:SmtpPort := 465
Is it possible that your CDO control also has such a requirement?
The eXpress train is coming - and it has more cars.

Post Reply