login about faq


i have to send encrypted and signed edifact mails with an base64 encoded attachment. Encryption and signing is working fine.

Now someone wrote me, that the attachment is not base64 encoded.

I use the chilkat.dll with powershell and add 1 attachment to every mail with: "$contentType = $email.AddFileAttachment($pathname)"

Is there a way to add the attachment as an base64 part ?

Regards Frank

asked May 31 '17 at 05:23

HecCon's gravatar image


The content-encoding of any attachment will automatically be base64, unless the content-type is a "text/..." content-type, in which case it will be quoted-printable.

The AddFileAttachment method will automatically choose the content-type based on the file extension of $pathname (i.e. the filename passed to AddFileAttachment). Thus, if the $contentType returned begins with "text/", then the attachment body will use the quoted-printable encoding (instead of base64).

You can instead call AddFileAttachment2($pathName, $contentType) where you can explicitly set the content-type. For example, pass a $contentType of "application/edifact". This will cause the attachment to be base64 encoded.


answered May 31 '17 at 22:01

chilkat's gravatar image

chilkat ♦♦


thanks for your answer. Then it must be an mistake from the receiver of our edifact mails.

Regards Frank


answered Jun 01 '17 at 03:15

HecCon's gravatar image


Your answer
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: May 31 '17 at 05:23

Seen: 3,273 times

Last updated: Jun 01 '17 at 03:15

powered by OSQA