Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Showing the GroupWise message interactively
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01250706
Message ID:
01250937
Vues:
19
>Hi Naomi,
>
>>Do you have a sample of lcText?
>
>lcText = "whoever@wherever.com"
>
>The "SetTextTo" changes the content of the "To:" field of a message.
>
>> I also need to add an attachment with my message.
>
>That would be the AttachmentAdd token, I'd think: http://developer.novell.com/documentation/gwtoken/gwtokens/data/hajef8ee.html
>
>>Also should I use this route in both cases (Auto and non-Auto or only non-Auto?)
>
>For anything that doesn't require user interaction, I'd probably try to use the other way first.

Hi Christof,

Thanks again for your invaluable support. Bellow is the code I'm using currently (I guessed two other tockens, didn't have time to research on Novell website). I was unable to use two additional optional parameters of AttachmentAdd, for some reason it didn't work for me. Anyway, here it is:
try
		lcBody = this.txt_MessageBody
		if len(m.lcBody) < NUMBEROFATTACHMENTS then
			lcBody = padr(m.lcBody, NUMBEROFATTACHMENTS, " ")
		ENDIF
		lcOldMessage = set("Message")
		set message to 'Sending an e-mail...'

		if m.lAuto

			oGW = createobject('NovellGroupwareSession')

			oMsg = oGW.Login.RootFolder.messages.add
			oMsg.Subject = m.Host.ReportTitle

			oMsg.BodyText = m.lcBody
			if '@' $ m.Host.EMail
				loRecipients = oMsg.Recipients.add(m.Host.EMail,'NGW','0')
			else
				loRecipients = oMsg.Recipients.AddByDisplayName(m.Host.EMail)
			endif
			loRecipients.Resolve()

			oMsg.Attachments.add(m.lcFile)
			oMsg.send()
			release oGW

		else && interactive mode
			lcResult = ""
			oGW = createobject("GroupWiseCommander")
			oGW.Execute("NewMail()", @lcResult)
			oGW.Execute([TextSetTo("] + m.Host.EMail + [")], @lcResult)
			oGW.Execute([TextSetSubject("] + m.Host.ReportTitle + [")], @lcResult)
			oGW.Execute([TextSetMessage("] + m.lcBody + [")], @lcResult)
			oGW.Execute([AttachmentAdd("] + m.lcFile + [")], @lcResult)			
		endif
		set message to (m.lcOldMessage)		

	catch to loException
		messagebox(thisform.txt_EmailFailed + ":" + chr(13) ;
			+ m.loException.message + chr(13) + chr(13) ;
			+ strtran(thisform.txt_SendManually, "$EMAIL", m.Host.EMail)+".", 16, m.Application.caption)
	endtry
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform