Advertisement
2002ASP Internet/ HTML #113

Download e-mail attachments

This code enables you to download and send e-mail, which will automatically put your attachments into a given directory.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Private Sub Command1_Click()
  MAPISession1.DownLoadMail = False
  MAPISession1.SignOn
  MAPIMessages1.SessionID = MAPISession1.SessionID
  MAPIMessages1.MsgIndex = -1
  
  MAPIMessages1.Compose
  MAPIMessages1.Send True
  
  MAPISession1.SignOff
End Sub
Private Sub Command2_Click()
  MAPISession1.DownLoadMail = True
  MAPISession1.SignOn
  MAPIMessages1.FetchUnreadOnly = True
  MAPIMessages1.SessionID = MAPISession1.SessionID
  MAPIMessages1.Fetch
  On Error Resume Next
  MAPIMessages1.AttachmentPathName = MAPIMessages1.AttachmentPathName '"c:\2000\" & MAPIMessages1.AttachmentName & "" 'vartype8 '& MAPIMessages1.AttachmentName & " '"
  Text1.Text = MAPIMessages1.MsgNoteText
  FileCopy MAPIMessages1.AttachmentPathName, ("c:\2000\" & MAPIMessages1.AttachmentName & "")
  MsgBox "File " & MAPIMessages1.AttachmentName & " sucessfully downloaded to C:\2000"
 
  MAPISession1.SignOff
End Sub
Original Comments (3)
Recovered from Wayback Machine