login about faq

The goal is to reject an email back to the originator, attaching his original email - which exists as a file on the disk. Everything works perfectly in my development system, but the program crashes in the production environment - no error, not event log entry - just poof - gone! Forwarding an email as a mime attachment should be pretty basic .... what am I missing

The process I'm using is:

'intitalize a Mime object

Dim mime As New ChilkatMime

success = mime.UnlockComponent("stuff")

Dim MyMailMan As New ChilkatMailMan2

success = MyMailMan.UnlockComponent("stuff")

Dim bundle As New ChilkatEmailBundle2

Dim email As New ChilkatEmail2

'load the original email - so we can convert to mime

Set email = MyMailMan.LoadEml(FileName$)

' Get the original email as a MIME object.

Dim originalEmailAsMimeObj As New ChilkatMime

success = mime.UnlockComponent("stuff")

Set originalEmailAsMimeObj = email.GetMimeObject()

' Create a new message/rfc822 MIME message, with a payload containing the original email.

mime.NewMessageRfc822 originalEmailAsMimeObj

' Create the new email and convert mime to email

Dim email2 As New ChilkatEmail2

email2.subject = SubjectLine$

email2.AddTo "", ToLine$

email2.FromAddress = AccountName$

email2.AddPlainTextAlternativeBody TextOfRejectionMessage$

'convert email2 to a MIME object.

Dim email2Mime As New ChilkatMime

success = email2Mime.UnlockComponent("stuff")

Set email2Mime = email2.GetMimeObject()

' The "mime" variable contains my message/rfc822 MIME with the original email. Append it as a new sub-part to email2Mime

'* it falls apart at the next line ** 'but ONLY on the production host ... it works fine on the development host

email2Mime.AppendPart mime

' now convert the mime back into 'standard' email, then send it.

email2.SetFromMimeText email2Mime.GetMime()

MyMailMan.SmtpHost = SMTPHost$

success = MyMailMan.SendEmail(email2)


everything works fine in the development environment, but it fails at the "append part mime" line bordered in asterisks above.

The only thing I can think of is that a dependancy might be missing on the production host.

anyone ever see anything like this?

any help would be appreciated.

Thanks in advance, John Bouma

asked Jun 01 '15 at 16:49

boumaj's gravatar image


Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jun 01 '15 at 16:49

Seen: 558 times

Last updated: Jun 01 '15 at 16:49

powered by OSQA