Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 To: Ahsan Rana
  Where is Ahsan Rana?
 Lahore
 Pakistan
 Ahsan Rana
 Tags
Subject: RE: CDO Configuration
Thread ID: 249156 Message ID: 249157 # Views: 8 # Ratings: 0
Version: Visual FoxPro 7 Category: Other
Date: Tuesday, December 29, 2009 5:46:32 PM         
   


> Hi Expert
>
> Following is the Code I use to Configure CDO Messaging but it does not configure. Can any one help me to Configure it. Afterward I try with Outlook Express. Now system successfully sending mail but it takes about one minute for each mail. My Mail sending code is also hereunder:
>
> LOCAL loConfig AS CDO.Configuration, loFlds AS Object, loMsg AS CDO.Message
>
> loConfig = CREATEOBJECT("CDO.Configuration")
> loFlds = loConfig.Fields
>
> WITH loFlds
> *- Set the CDOSYS configuration fields to use port 25 on the SMTP server.
> .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
>
> *- Enter name or IP address of remote SMTP server.
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 && 467
>
> *- Assign timeout in seconds
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 20
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = .t. && .f.
> .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "ahsanrana59@gmail.com"
> .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="abc"
> *!* .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
> *!* .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"
> .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
>
> .Update()
> ENDWITH
>
> **************************************************
>
> DECLARE SHORT InternetGetConnectedState In WinInet.Dll ;
> INTEGER @lpdwFlags, Integer dwReserved
> LOCAL lConnected
> lConnected = .F.
> lpdwFlags = 0
> IF InternetGetConnectedState (@lpdwFlags, 0) = 1
> lConnected = .T.
> ENDIF
>
> IF lConnected = .T.
> oMSG = CREATEOBJECT("CDO.Message")
> oMSG.To = Thisform.txtEmailAdd.Value
> oMSG.From = Thisform.txtSender.Value
> oMSG.Subject = Thisform.txtSubject.Value
> oMSG.TextBody = ALLTRIM(Thisform.Edit1.Value)
> IF !EMPTY(Thisform.txtAttachment.Value)
> oMsg.AddAttachment(Thisform.txtAttachment.Value)
> ENDIF
> oMSG.Send()
> WAIT WINDOW 'Message to '+ALLTRIM(nm)+' successfully delivered' NOWAIT
> ENDIF
>
> Rgds:
> Ahsan Rana

In CDO.message where are you using loConfig? You are creating the configuration but never using it.

Mike Gagnon
Refox XI +(English version)

ENTIRE THREAD

CDO Configuration Posted by Ahsan Rana @ 12/29/2009 4:41:10 PM
RE: CDO Configuration Posted by Mike Gagnon @ 12/29/2009 5:46:32 PM
RE: CDO Configuration Posted by Ahsan Rana @ 12/30/2009 5:19:21 AM
RE: CDO Configuration Posted by Mike Gagnon @ 12/30/2009 12:31:25 PM
RE: CDO Configuration Posted by Ahsan Rana @ 12/30/2009 4:22:24 PM
RE: CDO Configuration Posted by Don Higgins @ 12/29/2009 11:50:32 PM
RE: CDO Configuration Posted by Ahsan Rana @ 12/30/2009 5:13:35 AM
RE: CDO Configuration Posted by M. Akram Bhatti @ 12/30/2009 7:26:42 AM
RE: CDO Configuration Posted by Ahsan Rana @ 12/30/2009 4:34:00 PM
RE: CDO Configuration Posted by M. Akram Bhatti @ 12/30/2009 6:02:06 PM
RE: CDO Configuration Posted by Ahsan Rana @ 12/30/2009 6:40:41 PM
RE: CDO Configuration Posted by Mike Gagnon @ 12/30/2009 11:10:02 PM
RE: CDO Configuration Posted by Ahsan Rana @ 12/31/2009 4:11:44 AM
RE: CDO Configuration Posted by Mike Gagnon @ 12/31/2009 12:39:07 PM
RE: CDO Configuration Posted by Ahsan Rana @ 12/31/2009 7:12:30 PM
RE: CDO Configuration Posted by Mike Gagnon @ 1/1/2010 1:17:44 PM
RE: CDO Configuration Posted by Ahsan Rana @ 1/3/2010 6:20:24 AM
RE: CDO Configuration Posted by Mike Gagnon @ 1/3/2010 6:26:42 AM
RE: CDO Configuration Posted by Ahsan Rana @ 1/3/2010 2:26:19 PM
RE: CDO Configuration Posted by Mike Gagnon @ 1/3/2010 5:53:29 PM
RE: CDO Configuration Posted by Ahsan Rana @ 1/3/2010 6:31:31 PM
RE: CDO Configuration Posted by Mike Gagnon @ 1/4/2010 1:56:16 AM
RE: CDO Configuration Posted by Digant Vora @ 12/31/2009 6:54:22 AM
RE: CDO Configuration Posted by Mike Gagnon @ 12/31/2009 12:41:17 PM
RE: CDO Configuration Posted by khubaib khalid @ 1/4/2010 2:40:21 PM
RE: CDO Configuration Posted by Ahsan Rana @ 1/4/2010 4:53:03 PM
RE: CDO Configuration Posted by khubaib khalid @ 1/4/2010 5:03:36 PM