From: Rob van Erk on
Lotus Notes is also not my preferred mail system but if our customers'
company policy is to use Notes throughout the world (thousands of
Notes clients) than we have no alternative than to support our
customers with their mailsystem. Think the forum is not to argue about
what products to be used but instead to discuss how to support the
products being used by our customers.... All products will have their
pros / cons.

Thanks Dave for your input on this. Already had a look at the forum
but just wondered if someone had experience with Notes 6.5.4.

Brgds,
Rob

From: Dave Francis on
Rob,

Although I downloaded and developed under Notes 8 (I think), our client was
still on 6.5 (or thereabouts) and everything worked fine. Judging by earlier
stuff in this NG, the email interface has not changed since the Middle Ages.
[ I know Notes is past its sell-by date, but it's nice to find a bit of
stability in the industry every now and again. :o]

HTH

Dave Francis

"Rob van Erk" <erk.v(a)hotmail.com> wrote in message
news:f1c4fe0d-1b4f-4be5-b54f-a75077560f40(a)8g2000hse.googlegroups.com...
> Lotus Notes is also not my preferred mail system but if our customers'
> company policy is to use Notes throughout the world (thousands of
> Notes clients) than we have no alternative than to support our
> customers with their mailsystem. Think the forum is not to argue about
> what products to be used but instead to discuss how to support the
> products being used by our customers.... All products will have their
> pros / cons.
>
> Thanks Dave for your input on this. Already had a look at the forum
> but just wondered if someone had experience with Notes 6.5.4.
>
> Brgds,
> Rob
>


From: richard.townsendrose on
Rob

here's our code ... seems to mostly work

it based on dave's stuff, and there is a link to some other posts on
this ng.

richard

**************************

METHOD SendMailLotusNotes CLASS EmailSend
// NOT used ->
http://groups.google.com/group/comp.lang.clipper.visual-objects/browse_thread/thread/311ddccba5f9991a/795a46b0e58dfb4f?hl=en#795a46b0e58dfb4f
// revamp of daves stuff by rgtr 011107

/*FUNCTION SendEmailViaNotes(SendTo AS ARRAY, ; // array of email
addresses
CopyTo AS ARRAY,; // array of CC's
Subject AS STRING, ; // Subject text string
Body AS STRING, ; // Body text string
Attachment AS ARRAY, ; // array of file names to be
attached
SaveFolder AS STRING, ; // folder within Notes (eg
'Quotes') folder will be created if not present
nError REF DWORD) AS LOGIC PASCAL // feedback any error
codes
*/
LOCAL oApp AS oleautoobject // Appliction
LOCAL odb AS oleautoobject // Database
LOCAL oDoc AS oleautoobject // Document
LOCAL oRTI AS oleautoobject // RichText
LOCAL n AS DWORD
///////////////////////////////////////////////////
//
// Works with Notes 7.* and 8.* - may work with others
// Written for VO2.8 so does not destroy OLEAUTOOBJECTS
// Send(..) syntax used to avoid compiler warnings
//
// Designed to work from a "manned" pc with Notes installed.
Return address will be the user logged into this PC
//
/////////////////////////////////////////////////
//
// see codeproject.com/vbscript/SendMailLotusNotes.asp
//
// note use of CopyTo, extend to include BlindCopyTo if needed
//
// dbf(a)suilven.com - dave francis, partner
//
/////////////////////////////////////////////////

SELF:cErrorNo:='1' // till set to 0 if ok

// get a handle on Notes - if not running, this will open up a
Notes session - WHICH IS NOT CLOSED AFTER USE
oApp := OLEAutoObject{"Notes.NotesSession"}
IF oApp == NULL_OBJECT
SELF:cErrorMsg:='Failed to create OLEApp'
// nError := 1
RETURN FALSE
ENDIF

// open up the default database on this PC
IF IsMethod(oApp, #GetDataBase)
odb := Send(oApp,#GetDataBase, "","")
IF odb == NULL_OBJECT
SELF:cErrorMsg:='Failed to open database'
//nError := 2
RETURN FALSE
ENDIF
ELSE
SELF:cErrorMsg:='No Open Database Method - Is Lotus Notes
installed ?'
//nError := 2
RETURN FALSE
ENDIF

// silently open the mail interface
IF ! IVarGet(odb, #IsOpen)
Send(odb, #OpenMail)
ENDIF

// create a document to form basis of email
oDoc := Send(odb, #CreateDocument)
IF oDoc == NULL_OBJECT
SELF:cErrorMsg:='Failed to create mail document'
// nError := 3
RETURN FALSE
ENDIF

// seems to put oDoc into the right frame of mind
Send(oDoc, #ReplaceItemValue, "Form", "Memo")

IF SELF:aCCs #
NULL_ARRAY
//IF CopyTo #
NULL_ARRAY

//////////////////////////////////////////////////////////////////////////
//if you don't care about warnings, you can use this more readable
format...
// oDoc:replaceItemValue("CopyTo", CopyTo)

///////////////////////////////////////////////////////////////////////////
Send(oDoc, #ReplaceItemValue, "CopyTo", SELF:aCCs) // rgtr 011107
//Send(oDoc, #ReplaceItemValue, "CopyTo", CopyTo)
ENDIF

// we will assume SendTo is not
empty...
Send(oDoc, #ReplaceItemValue, "SendTo",
SELF:aRecipients[1]) // rgtr 011107
// Send(oDoc, #ReplaceItemValue, "SendTo", sendto)

// check subject string and apply
it
IF SELF:cTitle == NULL_STRING // rgtr 011107
//IF Subject == NULL_STRING
SELF:cErrorMsg:='Lost the title/subject'
//nError := 5
RETURN FALSE
ENDIF

Send(oDoc, #ReplaceItemValue, "Subject", SELF:cTitle) // rgtr
011107
//Send(oDoc, #ReplaceItemValue, "Subject",Subject)

// By applying body text as rich text, we have more scope for
clever bits in future...
oRTI := Send(oDoc, #CreateRichTextItem,"Body")
IF ! SELF:cMessage == NULL_STRING
// IF ! Body == NULL_STRING // rgtr 011107
Send(oRTI, #AppendText,SELF:CMessage) // rgtr 011107
// Send(oRTI, #AppendText,Body)
ENDIF

IF SELF:aDocuments # NULL_ARRAY // rgtr 011107 - changed 5
places
// IF Attachment # NULL_ARRAY
FOR n := 1 TO ALen(SELF:aDocuments)
IF ! File(SELF:aDocuments[n])
SELF:cErrorMsg:='Missing Attachment - ' + SELF:aDocuments[n]
//nError := 6
RETURN FALSE
ENDIF
NEXT n
FOR n := 1 TO ALen(SELF:aDocuments)
Send(oRTI, #EmbedObject,1454,"",SELF:aDocuments) // 1454 ==
EMBED_ATTACHMENT
NEXT n
ENDIF

// Save the chnages to the Doc or there is nothing to file away
Send(oDoc, #Save, TRUE, FALSE, TRUE) // we save it as already read

// IF SaveFolder #
NULL_STRING
// // store the doc in thsi
folder
// Send(oDoc, #PutInFolder,SaveFolder,TRUE) // this creates folder
if not there [folder names with blanks do NOT need extra quotes],

// ELSE
// // this saves in the Sent folder
// // Send(oDoc, #SaveMessageOnSend, true)
IVarPut(oDoc, #SaveMessageOnSend, TRUE) // change by received by
email

// ENDIF

// just send it
Send(oDoc,#Send,FALSE)

// NB no cleaning up done at all. May have to chnage in
future.
//nError := 0
SELF:cErrorNo:='0'
RETURN TRUE


// SELF:cErrorMsg:='Email using Lotus Notes not yet enabled'
//RETURN FALSE
From: Rob van Erk on
Richard,

Interesting code. Learning a lot of it.... Thanks.

Brgds,
Rob

From: Rob van Erk on
To all,

What code should I consider in case I simply would like to use a local
SMTP server iso using a Notes client. Basically this would result in
making the program more spreadly usable (not only Notes users). Is
there some code available for this? I assume details as SMTP server,
port number, email address (from/to) should be specified in the code
as well.

Thanks for any tips on this.

Brgds,
Rob

First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: VO & Vista Network
Next: Radio button and subdatawindow