Multipart-E-Mail (Xojo WE): Charset and Content-Transfer-Encoding missing

Hi there,

I’m trying to compose a multipart email message with XOJO Web Edition. But somehow XOJO won’t place the necessary informations about Content-Type and Content-Transfer-Encoding on top of the html- and text-boundaries.

In the sourcecode of a well formated email it should look like this:

[code]MIME-Version: 1.0
Content-Type: multipart/alternative;

This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable


But it looks like this - Charset and Content-Transfer-Encoding are missing:

[code]Content-Type: multipart/alternative; boundary=“4rytxhtkuls2”

Content-type: text/plain;


My code looks like this. MailSocket is a class with super SMTPSecureSocket. Emails are sent and look well formatted in my email-client. But other clients, which aren’t so capable in detecting the UTF8-format will show strange signs for the german Umlaute (, , , ).

Dim smtp As New MailSocket
Dim mail as EmailMessage
Dim i as integer

	// set up the socket
	smtp.Address = glbMailSMTP
	smtp.Port = 25
	smtp.SMTPConnectionMode = SMTPSecureSocket.ModeSTARTTLS
	smtp.username = stLoginMailAccount
	smtp.password = stLoginMailPwd
	// Subject codieren
	Dim Subject as string
	Subject=EncodeBase64(stSubject, 76)
	Subject = "=?utf-8?B?"+Subject+"?="
	mail = New EmailMessage
	mail.FromAddress = stFrom
	mail.subject = Subject
	mail.BodyHTML = vHMail
	mail.bodyPlainText = vTMail
	// Header
	mail.headers.appendHeader "X-Mailer",""
	mail.headers.AppendHeader "MIME-Version", "1.0"
	mail.headers.AppendHeader "Content-Type", "text/html; charset=UTF8"
	mail.headers.AppendHeader "Content-Transfer-Encoding", "8bit"
	mail.headers.AppendHeader "Return-Path", stFrom
	mail.headers.AppendHeader "Reply-To", stFrom
	// Mail anhngen und senden
	smtp.Messages.Append mail

Any ideas or assistance would be appreciated.

Either use CURL (directly or with the MBS plugin) or the Chilkat plugin.

You can also check if there is a Feedback case already existing. If not please create one. I’ve got a Feedback case with names of attachments duplicated, which is now over a year old I think.

Thanks Beatrix. I will give the Chilkat plugin a try.

I created a feedback case and hope for a quick solution.

Chilkat actually isn’t working for me. I just tried to use the XOJO-Plugin, but after compilation for a test run my mac says “Plugin ‘chilkat.xojo.plugin:0’ is not supported for Mac OS Carbon (Mach-O)” (I’m using macOS Sierra Version 10.12.3.).

Can you give me some advice how to use CURL directly in XOJO? And how to set up a MIME-E-Mail with CURL?

I think the problem with the Chilkat plugin came up recently. It wasn’t built correctly for the web edition. There was a manual workaround mentioned I think. Or you ask Matt for a newer build.

The workaround doesn’t work for me. Now I’m getting an error “chilkat.xojo_plugin:0 does not have a Mach-Oi386 part”. I told Matt about it and will be waiting for the next compilation of the Chilkat-Xojo-Plugin.

And I hope, that in upcoming XOJO-Releases this bug will be fixed. Why a bug?

I tried to put a well-formated E-Mail-Source with

aEmailMessage.Source = newStringValue

to my email-object. XOJO somehow parses the string, always deletes the info about the charset in “Content-Type” and replaces my “Content-Transfer-Encoding” with “7bit”.

I discovered that a simple HTML-Mail with no addiditional text-body works fine. So I’ll be using this in the meantime.

You could try the CurlEmailMBS class

Here is an example:

Also, the Mac OS Carbon (Mach-O) issues are resolved in this latest pre-release:

The official Chilkat v9.5.0.66 release will happen in about a week…

Did you file a bug report with a working sample?

Is there any order in which the message must be filled?

  1. Launch Feedback
  2. Type a summary of your problem in the search field at the top
  3. Press Search
  4. Look at the list of results and see if the case has already been filed
  5. If not, click Create New Case
  6. On the new case window, for best results fill in the fields from top to bottom.

@Greg O’Lone: I don’t this that creating a Feedback issue was the problem.

@Nieves Tuset: the order doesn’t matter. Please open a new topic if you have problems. Provided you show us your code.