Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why do I need to open outlook to send e-mail, part II ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00231324
Message ID:
00233079
Views:
36
this is my code, for doing internal mail with outlook, and attachments, this is in the click property, of a form with the OLE controls on the form
*-this Method creats an email, it attaches the required data
*-progmaticly
select mailtosend

copy to array paAttchFiles fields name for NOT mailtosend.done && copy file names to an array

*copy to array paAttchFiles fields mailtosend.done for not mailtosend.done  && copy file names to an array
thisform.OLESessionCtrl.Signon	&& Creat the logon session
with Thisform.OleMessageCtrl
	.SessionID = Thisform.OleSessionCtrl.SessionID	&& get the next ID no
	.Compose	&&compose an email in memory
	.RecipAddress = 'Iain Brodie'	&& address it to me
	.ResolveName	&& Let system find out the proper address
	.msgIndex = -1	&& set the Message Index count
	.msgsubject = alltrim(pcclientsname)	&& Put client name as the Subject
	.msgnotetext = "    Please Put on disk for Lewis Alcraft"	&& put this in the main body of message
	AttachmentDone=1	&& Creat a counting varible for the Attachment counter

	*-this for loop counts how many files there are to be attached
	*-for each file name there is two files to be attached
	for lncount = 1 to alen(paAttchFiles)
		.AttachmentIndex = AttachmentDone -1
		.AttachmentPathName = (pcclintspath+'download\'+paAttchFiles(lncount)+'SO.dbf')
		.Attachmentposition = AttachmentDone -1
		AttachmentDone=AttachmentDone+1
	endfor

endwith
*set step on
with thisform.OleMessageCtrl
	.send(1)	&& show predefined email with fields filled in
endwith
*-this part sets the flags on the data, so we do not get duplicate files
select mailtosend
for i = 1 to alen(paAttchFiles)
	loca for mailtosend.name=paAttchFiles(i)
	replace mailtosend.sentdate with datetime(), mailtosend.done with .T.
endfor
thisform.release
HTH
Iain Brodie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform