Visual Basic 6.0 Requires Chilkat v11.0.0+
Visual Basic 6.0
Create, save, and reopen a plain-text email
See more Email Object Examples
Set the sender, recipient, subject, and plain-text body. Save the result as an EML file, then open it in a second Email object and read its contents.
Chilkat Visual Basic 6.0 Downloads
Dim success As Long
success = 0
' Assumes Chilkat is unlocked. See Global Unlock Sample.
Dim email As New ChilkatEmail
email.From = "Sam Lee <sam@example.com>"
success = email.AddTo("Alex Rivera","alex@example.net")
If (success <> 1) Then
Debug.Print email.LastErrorText
Exit Sub
End If
email.Subject = "Hello"
email.Body = "This is a plain-text message."
success = email.SaveEml("message.eml")
If (success <> 1) Then
Debug.Print email.LastErrorText
Exit Sub
End If
Dim received As New ChilkatEmail
success = received.LoadEml("message.eml")
If (success <> 1) Then
Debug.Print received.LastErrorText
Exit Sub
End If
Debug.Print received.From
Debug.Print received.Subject
Debug.Print received.GetPlainTextBody()