login about faq

I have this in my code:

email.AddFileAttachment2(sa.GetString(j), 'UTF-8');

However, as you can see from the LastError, the file can't be attached.

ChilkatLog:
  AddFileAttachment:
    DllDate: Feb 15 2010
    Username: Administrator
    Component: ActiveX
    filename: D:\MailManAttach\GetSendMailMan\Out\Attachment\漢字仮å交ã˜ã‚Šæ–‡.txt
    contentType: UTF-8
    WindowsError: The system cannot find the file specified.
    Failed to add file attachment
    

What is the best solution for this? The ChilKatMime can extract the parts without any problem. The problem appears when attaching the file again.

asked Feb 11 '13 at 22:31

Delphinoy's gravatar image

Delphinoy
1222

edited Feb 11 '13 at 22:42

You are using an old version of the libraries (Feb 2010, latest is Dec 2012), so you should try updating to the latest version first and see if that fixes the problem. If not, come back and repost the LastErrorText in case it has changed.

(Feb 12 '13 at 09:02) jpbro ♦

oopsss...the AddFileAttachment2 is working..it's the sa.GetString that is returning the garbage. so now, I'm extracting the MimeParts manually and just take note of the Filename.

link

answered Feb 12 '13 at 02:05

Delphinoy's gravatar image

Delphinoy
1222

Make sure you tell each object involved, such as "sa" and "email" to pass strings as utf-8 and not ANSI. See http://www.cknotes.com/?p=98

For example:

sa.put_Utf8(true);
email.put_Utf8(true);
email.AddFileAttachment2(sa.GetString(j), 'image/jpg');

ALSO: The 2nd arg to AddFileAttachment2 is the MIME Content-Type for the attachment, NOT the charset.

link

answered Feb 18 '13 at 08:18

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

it seems the SA I'm using (Delphi Active X) doesn't have the charset property.

link

answered Feb 20 '13 at 22:25

Delphinoy's gravatar image

Delphinoy
1222

Did you update to the latest version (9.4.0/Dec 2012) of the library?

(Feb 21 '13 at 07:05) jpbro ♦
Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×184
×47
×1

Asked: Feb 11 '13 at 22:31

Seen: 1,428 times

Last updated: Feb 21 '13 at 07:05

powered by OSQA