login about faq

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

asked Nov 01 '13 at 15:54

DNoble94's gravatar image

DNoble94
1111

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×174
×96

Asked: Nov 01 '13 at 15:54

Seen: 837 times

Last updated: Nov 01 '13 at 15:54

powered by OSQA