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:
This is a multi-part message in MIME format.
But it looks like this - Charset and Content-Transfer-Encoding are missing:
[code]Content-Type: multipart/alternative; boundary=“4rytxhtkuls2”
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 = "=?utf-8?B?"+Subject+"?="
mail = New EmailMessage
mail.FromAddress = stFrom
mail.subject = Subject
mail.BodyHTML = vHMail
mail.bodyPlainText = vTMail
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
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.
Here is an example: https://www.example-code.com/xojo/email_charset.asp
Also, the Mac OS Carbon (Mach-O) issues are resolved in this latest pre-release:
The official Chilkat v126.96.36.199 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?
@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.