Question:
In my activeX asp code I'm trying to append the attachment contents, if it is a text file, to the body of the email message. But I can't figure out how ... Appreciate the help.
success = imap.SelectMailbox("INBOX")
fetchUids = 1
Set messageSet = imap.Search("ALL", fetchUids)
If (messageSet Is Nothing ) Then
Response.Write imap.LastErrorText & "-*4*<br />"
End If
Set bundle = imap.FetchBundle(messageSet)
iMaxMessages = 4
iTotalMessages = bundle.MessageCount
iLoopMax = iMaxMessages
If iTotalMessages < iMaxMessages Then
iLoopMax = iTotalMessages
End If
For iInxX = 0 To iLoopMax - 1
Set email = bundle.GetEmail(iInxX)
Response.Write "iInxX=" & iInxX & "..." &"msgId=" & messageSet.GetId(iInxX) & "..."
Response.Write "From=" & Server.HTMLEncode( email.From) & "..."
Response.Write "FromAddress=" & Server.HTMLEncode( email.FromAddress) & "..."
Response.Write "Subject=" & Server.HTMLEncode( email.Subject) & "..."
Response.Write "Date=" & Server.HTMLEncode( email.LocalDate) & "..."
Response.Write "Attachment Count=" & email.NumAttachments & "..."
Response.Write "<br />"
Response.Write "Body=" & Server.HTMLEncode( email.Body )& "..."
Response.Write "AttachmentFile=" & imap.GetMailAttachFilename(email,0)& "..."
Response.Write "<br />"
msgId = messageSet.GetId(iInxX)
isUid = messageSet.HasUids
sFolder = "INBOX/Processed"
success = imap.Copy(msgId,isUid,sFolder)
success = imap.SetMailFlag(email,"Deleted",1)
Next