Archived Forum Post

Index of archived forum posts

Question:

mim appendpart works on one computer, not another

Jun 01 '15 at 16:49

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