Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29745

Attaching HTML file as email in VB 6.0

$
0
0

I am trying to attach an html file file to email using Visual Basic 6.0. when the cursor is comes on Open strFile For Binary Access Read As #hFile line it gives error "Error encoding file - Bad file name or number". Please all your help and support would be highly appreciated.

Dim handleFile               As Integer
Dim strValue              As String
Dim lEventCtr           As Long
handleFile = FreeFile
Open strFile For Binary Access Read As #handleFile
Do While Not EOF(hFile)
    ' read & Base 64 encode a line of characters
    strValue = Input(57, #handleFile)
    SendCommand EncodeBase64String(strValue) & vbCrLf

    ' DoEvents (occasionally)
    lEventCtr = lEventCtr + 1
    If lEventCtr Mod 50 = 0 Then DoEvents
Loop
Close #handleFile
Exit Sub
File_Error:
Close #handleFile
m_ErrorDesc = "Error encoding file - "& Err.Description
Err.Raise Err.Number, Err.Source, m_ErrorDesc
End Sub

Viewing all articles
Browse latest Browse all 29745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>