Please tell me how to save attach eml in vb6 effectively?

Asked By 70 points N/A Posted on -
qa-featured

Hi Techyv members,

Please tell me how to save attach EML in Vb6 effectively. What are the steps needed for this kind of attachment? Please show me a step by step process for this. Also, please include a few pointers about the issues to be encountered if there is any.

SHARE
Answered By 5 points N/A #131244

Please tell me how to save attach eml in vb6 effectively?

qa-featured

Hi Salie Givson,

You can do so using a third party ActiveX Control.

First download the ActiveX from here and install it.

Now add a reference to the just downloaded Activex control in your vb6 program.

Then check the following codes.

Dim email As New ChilkatEmail

email.Subject = "This is a Subject"
email.Body = "This is a body"
email.From = "[email protected]"
email.AddTo "Jack","[email protected]"

Dim success As Long

Dim contentType As String
contentType = email.AddFileAttachment("il1120.pdf")
If (contentType = vbNullString ) Then
    Text1.Text = Text1.Text & email.LastErrorText & vbCrLf
    Exit Sub
End If

success = email.SaveEml("email.eml")
If (success = 0) Then
    Text1.Text = Text1.Text & email.LastErrorText & vbCrLf
    Exit Sub
End If

MsgBox "EML Saved Successfully"

Hope this would help.

Related Questions