Sample code for 30+ languages & platforms
VBScript Requires Chilkat v11.0.0+

Create an inline forward

See more Email Object Examples

Create a forward from a saved email, set the forwarding author and destination, and inspect the generated subject and body. Save the draft before submitting it to SMTP. To introduce the original with a separate cover note, use the attached-message example.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

'  Assumes Chilkat is unlocked. See Global Unlock Sample.

set original = CreateObject("Chilkat.Email")
success = original.LoadEml("alternatives.eml")
If (success <> 1) Then
    outFile.WriteLine(original.LastErrorText)
    WScript.Quit
End If

set forward = CreateObject("Chilkat.Email")
success = original.ToForward(forward)
If (success <> 1) Then
    outFile.WriteLine(original.LastErrorText)
    WScript.Quit
End If

forward.From = "Workshop team <events@example.com>"
success = forward.AddTo("Coordinator","coordinator@example.net")
If (success <> 1) Then
    outFile.WriteLine(forward.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine(forward.Subject)
If (forward.HasHtmlBody() = 1) Then
    outFile.WriteLine(forward.GetHtmlBody())
Else
    outFile.WriteLine(forward.GetPlainTextBody())
End If

success = forward.SaveEml("forward.eml")
If (success <> 1) Then
    outFile.WriteLine(forward.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine("Saved forward.eml.")

outFile.Close