Sample code for 30+ languages & platforms
Visual Basic 6.0

Save HTML Email Embedded Images

Saves HTML embedded items to files in a subdirectory. Images, style sheets, and anything else embedded within HTML, are not considered to be attachments. Instead, these items are "related item". The Chilkat email object provides a set of methods/properties for accessing the related items within an email.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim email As New ChilkatEmail

' Load an email object containing HTML with embedded images.

success = email.LoadEml("myEmails/HtmlEmail.eml")
If (success <> 1) Then
    Debug.Print email.LastErrorText
    Exit Sub
End If

' Iterate over the related items.  
' Print the file name and save each to a file.
Dim i As Long
i = 0
Dim numRelated As Long
numRelated = email.NumRelatedItems
Do While i < numRelated

    Debug.Print email.GetRelatedFilename(i)

    success = email.SaveRelatedItem(i,"myRelatedItemsDir")
    If (success <> 1) Then
        Debug.Print email.LastErrorText
        Exit Sub
    End If

    i = i + 1
Loop