Extra characters at end of attachment - WeOnlyDo Discussion board

Extra characters at end of attachment (wodSFTP / wodSFTP.NET / wodSFTPdll)

by SSanders, Wednesday, November 22, 2006, 19:53 (6385 days ago)

Using wodSMTP COM in VB6, I am getting extra characters appended to my attachments (ASCII comma separated files). Each message has only one attachment.

====== code ==========
Dim MsgPart As SmtpMsg
Dim mFileName As String

mFileName = fso.GetFileName(mgMessage.Attachment)
Set MsgPart = SMTPCom.Message.Attach(mgMessage.Attachment)
MsgPart.Headers.Add Content-Type , multipart/mixed
MsgPart.Headers.Add Content-Disposition , _
attachment; filename= & mFileName &
====== /code ==========

Here's a sample of what is ending up added to the end of my attachment: Jkiç]º /xÍ{wMv

Any ideas about what could be causing the problem?
Thanks!


Re: Extra characters at end of attachment

by woddrazen, Wednesday, November 22, 2006, 20:29 (6385 days ago) @ SSanders

Hi,


Why don't you try to use CreateSimpleAttachment Method instead using headers.

Here is example:
-----------------------------------------------------
Set smtp1 = New wodSmtpCom

smtp1.CreateSimpleAttachment weonlydo@test.com , drazen@drazen.com , test , this is test , c:\private.txt
'smtp1.Message.Save C:\test.eml
smtp1.SendMessage
-----------------------------------------------------

More help for CreateSimpleAttachment Method you can find here:
http://www.weonlydo.com/Smtp/Help/WODSMTPLib~wodSmtp~CreateSimpleAttachment.html

Hope this helps.


Regards,
Drazen

Re: Extra characters at end of attachment

by SSanders, Sunday, November 26, 2006, 02:32 (6382 days ago) @ woddrazen

The problem with that solution is that I need to be able to use the CC and BCC addresses as well. SendSimpleAttachment doesn't support those address types.

Any other ideas?

Thanks!

Re: Extra characters at end of attachment

by SSanders, Sunday, November 26, 2006, 02:36 (6382 days ago) @ SSanders

Okay, maybe I responded too soon. I was looking at SendSimpleAttachment.

If I use CreateSimpleAttachment, can I go back and add the other addresses that I need before I use the SendMessage method?

Re: Extra characters at end of attachment

by wodDamir, Sunday, November 26, 2006, 14:18 (6382 days ago) @ SSanders

Hi,

Yes, you will still be able to set CC and BCC addresses by setting CC and BCC Properties.

Regards,
Damba