Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Activating Lotos Notes Email System
Message
De
26/07/2001 04:43:38
 
 
À
26/07/2001 04:18:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00535560
Message ID:
00535568
Vues:
11
Mark,
I'm not sure what you mean with activating, but if you want to send mail with VFP/Notes the following code may get you started:
LPARAMETER tcRecipient, tcSubject, tcMessage, tcAttachment

*-- check parameters ------------------------------------------------------------------------------
IF TYPE("tcRecipient")  "C" OR EMPTY(tcRecipient)
	??CHR(7)
	WAIT WINDOW NOWAIT "Parameter 1 : Parameter missing or wrong type. Procedure canceled!"
	RETURN -1
ENDIF
IF TYPE("tcSubject")  "C" OR EMPTY(tcSubject)
	??CHR(7)
	WAIT WINDOW NOWAIT "Parameter 2 : Parameter missing or wrong type. Procedure canceled!"
	RETURN -2
ENDIF
IF TYPE("tcMessage")  "C" OR EMPTY(tcMessage)
	??CHR(7)
	WAIT WINDOW NOWAIT "Parameter 3 : Parameter missing or wrong type. Procedure canceled!"
	RETURN -3
ENDIF
IF NOT EMPTY(tcAttachment) AND (TYPE("tcAttachment")  "C" OR NOT FILE(tcAttachment))
	??CHR(7)
	WAIT WINDOW NOWAIT "Parameter 4 : File not found. Procedure canceled!"
	RETURN -4
ENDIF
*--------------------------------------------------------------------------------------------------

LOCAL loNotes, loDb, loDoc, lcMsg, loRichTextItem

loNotes = CreateObject("Lotus.Notessession")   && create notes session
loNotes.initialize("daniel")                   && password

loDBDir = loNotes.GetDBDirectory("")           && Get object
loDb = loDBDir.OpenMailDatabase()              && Get default mail database for current user


*loDb = loNotes.GetDatabase("", "")            && set db to database not yet named
*loDb.openmail                                 && set database to default mail database

loDoc = loDb.CreateDocument                   && create a mail document

loDoc.ReplaceItemValue("SendTo", tcRecipient) && Recipient
loDoc.ReplaceItemValue("Subject", tcSubject)  && Subject
loDoc.ReplaceItemValue("Body", tcMessage)     && Message Body

*-- check if there's an attachment
IF NOT EMPTY(tcAttachment)
	loRichTextItem = loDoc.CreateRichTextItem("Attachment") &&
	=loRichTextItem.EmbedObject(1454, "", tcAttachment)     && attach a file
ENDIF

loDoc.Save(.T., .T.) && save message
loDoc.Send(.F.)      && send message

RELEASE loNotes

RETURN 0
>Hi,
>
>I currently have written a application in VFP6.0 which has an option to activate Microsoft outlook. One of our customers now wants the ability to email in Lotus Notes email system.
>
>Did anyone come across this problem before? Any feedback would be appreciated, as I am not sure if it can be done.
>
>
>Regards
>Merk
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform