using CDONTS Email can't be send

Topics: Developer Forum, User Forum
Aug 18, 2010 at 10:40 AM

hello,

while sending a mail using SMTP E-Mail  an Error is occured

error is as follows

  00004nc9000c err#= 1733 line= 219 Class definition CDONTS.NEWMAIL is not found.1733 Class definition CDONTS.NEWMAIL is not found. CDONTS.NEWMAIL .NULL. .NULL. .NULL. .NULL. c:\program files\dotcomsolution\avfpdemo41\activevfp.dllerror '800a06c5'

c:\program files\dotcomsolution\avfpdemo41\activevfp.dll

/mywstudent/default.asp, line 6

 

i have copied the CDONTS.dll on my machine but while registring with regsvr32 it is not registerd.

After going through google , it was found that the CDONTS is depricated by Microsoft  and new one i.e. CDOSYS can be used to send E mail

my machine configuration is

OS = windows 2003 server

 VFP9

 

my prolem is

1) how to send E-Mail Using CDOSYS  :( i have made the modification in main.prg i.e in action=email2 routine as  follows

 oMail =CreateObject("CDOSYS.Newmail")<font face="Courier New" size="2">

but same error occurd

 

Thankyou

 

</font>

 

 

Coordinator
Aug 18, 2010 at 1:28 PM

Looks like I included some old CDONTS code  instead of using the SMTP class.  Try the following instead:

CASE oProp.Action=='email2'
    oSMTP.cSMTPServer='smtp.east.cox.net'  && enter your smtp server name or ip
    oSMTP.cSenderName = oRequest.FORM("txtMailFrom")
    oSMTP.cRecipient= oRequest.FORM("txtMailTo")
    oSMTP.cBCCList = oRequest.FORM("txtMailBcc")
    oSMTP.cSubject = oRequest.FORM("txtMailSubject")
    oSMTP.cMessage = oRequest.FORM("S1")
    lcSuccess=oSMTP.CDOsend()
    lchtmlfile = 'email2.htm'
    lcHTMLout= FILETOSTR(oProp.HTMLpath+lchtmlfile)
    lcHTMLout= oHTML.mergetext(lcHTMLout)

Aug 20, 2010 at 7:35 AM

thanks claude

The problem is solved

actully i was forgot  to name  my SMTP server

and in main.prg i commented the omail object

my another question is

Can we execute the Stored Procedure of SQL through ActiveVfp if Yes How ?

once agian thanks for your valuable advice

 

  

 

 

 

Coordinator
Aug 20, 2010 at 10:47 AM

I guess if the Execute method in the SQL class won't do it, I'll need to add an ExecuteStoredProcedure method to the SQL class.  I'll let you know when this is done..

Aug 25, 2010 at 7:46 AM
Edited Aug 25, 2010 at 7:49 AM

SQL Stored Procedure can be Executed Through VFP9

Here is a Sample Code

mystring="server=COMPLAB2\SQLEXPRESS;driver={SQL Server};database=Student;Trusted_Connection=Yes"

myhandle=SQLSTRINGCONNECT(mystring)

IF myhandle < 0

=MESSAGEBOX('Cannot make connection', 16, 'SQL Connect Error')

ELSE

 = MESSAGEBOX('Connection made', 48, 'SQL Connect Message')

 

 

DO myproc

=SQLDISCONNECT(myhandle)

ENDIF

PROCEDURE errhand

PARAMETERS err,command

IF err > 0

 WAIT WINDOW ALLTRIM(UPPER(command))+"Completed Successfully"; 

 NOWAIT 

ELSE

WAIT WINDOW UPPER(command)+"NOT Completed Successfully"

ENDIF

RETURN 

 

 

PROCEDURE myproc

sqlcomm= "execute StdList"   && this is the Stored Procedure Name in SQL

err=SQLExec(myhandle,sqlcomm)

DOerrhand WITH err,"SQLExec(handle,"+sqlcomm+")"

IF err > 0

=MESSAGEBOX('Executed Successfully', 16, 'SQL success')

ENDIF

 

 

Coordinator
Aug 25, 2010 at 1:59 PM

Cool, then you should be able to test and use the SQL class and methods in ActiveVFP.  there's an example in main.prg that you just have to modify.

Sep 3, 2010 at 7:25 AM

while Using Chat example when i click on Talk button ,again same default page appears 

any suggession ?

 

Coordinator
Sep 3, 2010 at 4:24 PM
Edited Sep 3, 2010 at 4:27 PM

That one I haven't had time to look into.  It was supposed to just be a jquery example but I'm considering taking it out all together.  If you could look into and fix it up it would be greatly appreciated!

It's based on a PHP example where I just swapped out PHP code for VFP code located here:  http://articles.sitepoint.com/print/ajax-jquery