Hi,
I assume you're referring to the Notes server since (AFAICR) the "CreateObject("Notes.NotesSession")" should create the client session OK.
If you are referring to the server and if it's not running then there's not much you can do about it :-{
Regards,
Viv
>hi guys and gals,
>
>got this piece of code and honestly it does the trick, only to realize that the LN should be up and running. my ? is that, is there a way to automate lotus notes even if its not running? can someone help me point to the salvation road? thanks in advance
>
> LOCAL lcSubject , lcReceipient, lcBodyText, llSaveIt
> LOCAL loSession , loMailDB , loMailDoc
> LOCAL lcServer , lcMailFile , loRichText, loAttachment
>
> *-- Set Variaibls for mail
> lcSubject = "Test Notes Email from VFP"
> lcReceipient = "
its-ra_saci.sm.ho@sm-shoemart.com"
> lcBodyText = "This is the main message of the Email"
> llSaveIt = .F.
>
> *--------------- Notes Automation ------------------
> loSession = CreateObject("Notes.NotesSession")
>
> lcServer = loSession.GetEnvironmentString("MailServer",.T.) && Causes Notes To Ask for Auth
> lcMailFile = loSession.GetEnvironmentString("MailFile",.T.) && Causes Notes To Ask for Auth
>
> *-- Open the mail database in notes
> loMailDB = loSession.GetDatabase(lcServer,lcMailFile)
>
> *-- If Mail Database not open, open it.
> IF !loMailDB.IsOpen
> loMail.OpenMail()
> ENDIF
>
> *-- Setup new Mail Document.
> loMailDoc = loMailDB.CreateDocument() && Causes Notes To Ask for Auth
> WITH loMailDoc
> .Form = "Memo"
> .SendTo = lcReceipient
> .Subject = lcSubject
> .Body = lcBodyText
> .SaveMessageOnSend = llSaveIt
>
> loRichText = .CreateRichTextItem("loAttachment")
> loAttachment = loRichText.EmbedObject(1454,"","c:\autoexec.bat")
>
> *-- Send the Document
> .PostedDate = DATE()
> .Send(0)
> ENDWITH
>
> loMailDoc = .NULL.
> loMailDB = .NULL.
> loSession = .NULL.