Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
E-mail from FoxPro using Groupwise
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00764746
Message ID:
00765099
Vues:
16
********************************************************************
*  Description.......: MailWithGroupWise - used for sending mails with GroupWise as Mail Client
*  Calling Samples...: MailWithGroupWise('nnosonov@thewarrengroup.com','SUBJECT HERE','TEXT MESSAGE HERE ','O:\REDP\OUTPUT\CUstomer\Fares\Trwc0122.zip')
*  Parameter List....: cSendTo,cSubject,cMessage,cAttachment
*  Created by........: Robert Peirce
*  Modified by.......: Nadya Nosonovsky 06/14/2002 04:15:37 PM
********************************************************************
lparameters cSendTo,cSubject,cMessage,cAttachment
if vartype(m.cSendTo)<>"C" or empty(m.cSendTo)
	=messagebox('Invalid Send To parameter passed',48,"Invalid parameter")
	return -1
endif
set message to '    Sending an e-mail...'
local oGW, lcOldError, lnReturn, loMessage
lcOldError=on('error')
on error lnReturn=-1
lnReturn=0
oGW=createobject('NovellGroupwareSession')
if vartype(oGW)='O' && Group Wise object was successfully created	
	local oMsg, loRecipients, lnRecipients, lnI, lnAttachments
	oMsg=oGW.Login.RootFolder.messages.add
	oMsg.Subject = m.cSubject
	oMsg.BodyText = m.cMessage
	lnRecipients=alines(laRecipients,strtran(m.cSendTo,";",chr(13)))
	if vartype(m.cAttachment)='C' and !empty(m.cAttachment)		
		lnAttachments=alines(laAttachments,strtran(m.cAttachment,";",chr(13)))
	else
		lnAttachments = 0 && No attachments
	endif
	for lnI=1 to m.lnRecipients
		cSendTo=laRecipients[m.lnI]
		if '@' $ m.cSendTo
			if left(m.cSendTo,5)<>'inet:'
				m.cSendTo = 'inet:'+ m.cSendTo
			endif
			loRecipients=oMsg.Recipients.add(m.cSendTo,'NGW','0')
		else
			loRecipients=oMsg.Recipients.AddByDisplayName(m.cSendTo)
		endif
		loRecipients.Resolve()
	endfor
	for lnI=1 to m.lnAttachments
		cAttachment=laAttachments[m.lnI]
		if !file(m.cAttachment)
			=messagebox("File "+ m.cAttachment+" is not found!",48,'File not found')
			lnReturn=-1
			exit
		endif
		oMsg.Attachments.add(m.cAttachment)
	endfor
	if m.lnReturn=0 && No errors yet
		oMsg.send
	endif
	release oGW
else
	lnReturn=SendMails(,,m.cSendTo,m.cSubject,m.cMessage,m.cAttachment) && Wrapper for Nigel's class
endif
on error &lcOldError
return m.lnReturn
There are some hidden rocks with GroupWise. We had to switch to commercial software IDSMail. Now we don't have GroupWise, but we're still using IDSMail...

>Hi,
>
>I am tring to add e-mail capability to an application.
>
>Our client uses a Novell server and Groupwise for e-mails.
>From the Novell website I could downliad some files for 'Groupwise MAPI'. These are Source code files, Resource files & Header files written in C.
>
>But I am not sure how to incorporate this in the FoxPro program.
>The header file includes #define statements as well as some User Defined data types.
>
>Any help will be greatly appreciated.
>
>Thank you.
>
>Ria
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform