Mike, my pleasure
S

parameter wasitanupdate
gogmess=''
IF wasitanupdate
   WAIT WINDOW NOWAIT 'Now updating your system '+CHR(13)+;
   'This may take from 1 to 2 minutes and does not require you to press any
keys. Coffee time ?........'
ELSE
   WAIT WINDOW NOWAIT 'Now preparing sending the message........'
ENDIF

DO trmoment WITH 'moment'
trcask69=''
TRY
   **http://fox.wikis.com/wc.dll?Wiki~CdoEmail~VFP
   Local lcSchema, loConfig, loMsg, loError, lcErr
   lcErr = ""
   lcSchema = "http://schemas.microsoft.com/cdo/configuration/";
   loConfig = Createobject("CDO.Configuration")
   With loConfig.Fields
      .Item(lcSchema + "smtpserver") = "smtp.gmail.com"
      .Item(lcSchema + "smtpserverport") = 465 && รณ 587
      .Item(lcSchema + "sendusing") = 2
      .Item(lcSchema + "smtpauthenticate") = .T.
      .Item(lcSchema + "smtpusessl") = .T.
      .Item(lcSchema + "sendusername") = "myusername"
      .Item(lcSchema + "sendpassword") = "mypassword"
      .Update
   Endwith
   loMsg = Createobject ("CDO.Message")
   mattachmnt=""
   IF FILE("INFO.JPG")
      IF !wasitanupdate
         mattachmnt= "YES"       &&SYS(5)+CURDIR()+"INFO.JPG"
    && full path=imperative
      endif
   endif

   With loMsg
      .Configuration = loConfig
      .From          = "[email protected]"
      .To            = "[email protected]"
      If wasitanupdate
         .Subject       = "WinkissUpdate"
      Else
         .Subject       = "WK-ErrorReport"
         IF mattachmnt="YES"
            .AddAttachment(SYS(5)+CURDIR()+"INFO.JPG")
         endif
      ENDIF

      mq=''
      IF USED("WINDEBS")
         mq="D:"+ALLTRIM(STR(RECCOUNT("WINDEBS")))
      endif
      IF USED("PEMP")
         mq=mq+",P:"+ALLTRIM(STR(RECCOUNT("PEMP")))
      endif
      IF USED("GLTRANS")
         mq=mq+",G:"+ALLTRIM(STR(RECCOUNT("GLTRANS")))
      endif
      gogmess=mq
      gogmess=gogmess+" G,System: "+ALLTRIM(winkiss.popup7)+CHR(13)

      gogmess=gogmess+" Debtors : "+ALLTRIM(winmast.name)  +CHR(13)
      gogmess=gogmess+" Payroll : "+ALLTRIM(pmaster.name)  +CHR(13)
      gogmess=gogmess+" Gl      : "+ALLTRIM(glmaster.name) +CHR(13)

      If wasitanupdate
         gogmess=gogmess+" Updated from "+ALLTRIM(STR(trcask56,10,2))+" to:
"+trdate2()
      else
         gogmess=gogmess+errmess
      ENDIF

      .TextBody      = gogmess
      .Send()
   Endwith

Catch To loError
   trcask69=[Error: ] + Str(loError.ErrorNo) + Chr(13) + [Line: ] +
Str(loError.Lineno) + Chr(13) + [Message: ] + loError.Message
   lcErr   =[Error: ] + Str(loError.ErrorNo) + Chr(13) + [Line: ] +
Str(loError.Lineno) + Chr(13) + [Message: ] + loError.Message

Finally
   Release loConfig, loMsg
   Store .Null. To loConfig, loMsg
   If !wasitanupdate
      If Empty(lcErr)
         Messagebox("Message sent", 64, "Have a great day")
      Else
         Messagebox(lcErr, 16 , "Error")
      ENDIF
   endif
ENDTRY
DO trmoment

IF AT("0x80040127",trcask69)>0
   =MESSAGEBOX("Windows Information message 80040127"+CHR(13)+;
   "This message is NOT an urgent message, but if you see it, please drop us
a note/email to say you spotted it"+CHR(13)+;
   "A simple little message that says 'gotcha' will do. Many thanks
",0,'')
ENDIF

IF !EMPTY(trcask69)
   DO trblat899 WITH wasitanupdate, gogmess
ENDIF

On Wed, May 26, 2010 at 1:05 PM, MB Software Solutions, LLC <
[email protected]> wrote:

> Sytze de Boer wrote:
> > I tried but gave up and use Gmail with
> > loConfig = Createobject("CDO.Configuration")
> >
> > Very simple, it works
> > S
>
>
> Can you share the rest of the code?
>
> --
> Mike Babcock, MCP
> MB Software Solutions, LLC
> President, Chief Software Architect
> http://mbsoftwaresolutions.com
> http://fabmate.com
> http://twitter.com/mbabcock16
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to