Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SMTP Event Sink - email within an email
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
SMTP Event Sink - email within an email
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01436380
Message ID:
01436380
Views:
108
Hi All,

Still working on this SMTP Event Sink archive but have hit a bit of a problem that I could do with a bit of help with at the moment.

When an email in received which contains another attached email I see how to access the attached email. cdoContentMediaType="message/rfc822".
Registered with:
cscript smtpreg.vbs /add 1 onarrival SMTPEventSink SMTP.EventSink "RCPT TO=*"
PROCEDURE ProcessMessage
	LPARAMETERS toMsg, tnEventStatus, tnParentId
	WITH toMsg
		* This loop works fine
		FOR EACH loField in .Fields		&& fails because .Fields does not exist
			lcField=loField.Name+": "+TRANSFORM(loField.Value)
			lcFieldList=lcFieldList+lcField+CRLF
		ENDFOR

		FOR EACH loAttachment in .Attachments
			lcMediaType = loAttachment.fields.item(cdoContentMediaType).value
			lcFileName = loAttachment.fields.item(cdoAttachmentFilename).value
			IF LOWER(lcMediaType) = "message/rfc822" AND ISNULL(lcFileName)

				* loStream.SaveToFile('00.eml') - fails

				loStream = loAttachment.GetStream()
				FOR EACH loField in loStream.Fields		&& fails because .Fields does not exist
				ENDFOR

				loContentStream = loContentStream.GetDecodedContentStream()
				FOR EACH loField in loAttachment.Fields		&& again fails because .Fields does not exist
				ENDFOR

			ENDIF
		ENDFOR
Any suggestions how I can attack this problem, is there any known way to persist this object so that I can examine it's objects and collections?
Reply
Map
View

Click here to load this message in the networking platform