How to send SMTP message containing Unicode message

For questions and postings not covered by the other forums
stevek2
Posts: 14
Joined: Fri Nov 13, 2015 5:04 pm

How to send SMTP message containing Unicode message

Postby stevek2 » Thu Mar 10, 2016 6:44 pm

I have a Korean customer that needs to send email messages containing characters in English and Korean characters.
And just to add extra feature, the text can be in RTF format (coming from a Jade Rich text control)

I am sending emails via the CardSchema SMTP framework built into our application.

Just wondering what is the correct format for these email messages to ensure they are received correctly?

I thought the best way was to format the message with a smtp.contentType = "html" and add basic html around the message header (as per the Card Schema smtp documentation).

not having much luck - anyone else have a solution that works?

Cheers
Steve

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: How to send SMTP message containing Unicode message

Postby BeeJay » Fri Mar 11, 2016 3:53 pm

I don't think the CnSmtp class handles extended Unicode characters currently, at least it didn't last time I tried using it as any extended characters ended up as #'s or square boxes in the generated e-mail. For the work I was doing at the time, this wasn't critical so I didn't follow up to see if there was a version of CardSchema that does handle extended Unicode characters correctly etc. You may have to check with the CardSchema support people to see if they can advise if there's a version of CardSchema that does support this.

Cheers,
BeeJay.

mjagers
Posts: 17
Joined: Wed Sep 22, 2010 5:22 pm

Re: How to send SMTP message containing Unicode message

Postby mjagers » Mon Mar 14, 2016 9:05 am

Re the SMTP contentType:
Permissible values are plain, html or null. If the attribute contains null, it defaults to plain. The attribute is case-insensitive.
The contentType indicates how mail clients should present the message after retrieving it from the server.
The CnSmtpConnection class does not generate HTML; however, if you compose your message as raw HTML, and set the contentType property to html, an HTML-capable mail client will interpret the tags in your message correctly. This means that you can send a message containing links, tables, and other HTML features.
A contentType of plain instructs mail clients to treat the message text as plain ASCII.

stevek2
Posts: 14
Joined: Fri Nov 13, 2015 5:04 pm

Re: How to send SMTP message containing Unicode message

Postby stevek2 » Tue Mar 15, 2016 6:55 pm

I had figured out the Unicode (and Korean character set) is not the problem, Jade and Card Schema handle this ok.

The problem is the email itself which is being sent as Plain text which gets screwed up when received by email clients.
Similar to mjagers comments, I had amended the ContentType to HTML and inserted some basic html commands around the text (following the example set in Card Schema sending Inline messages). This is where I still have some testing to do as it is not quite working the way I expected.

I did get the customer to send me a sample email with Korean text and it was received correctly on my side.
When I analysed the Email Message content, it appears to rely on using Content IDs (CIDs) instead - so that may be my next course of action.

Thanks for replies.

mjagers
Posts: 17
Joined: Wed Sep 22, 2010 5:22 pm

Re: How to send SMTP message containing Unicode message

Postby mjagers » Mon Jul 11, 2016 11:21 am

The JADECare Start 3.8.03 release has been modified to facilitate multi-byte character sets. Details from the release notes as follows:

Changes allow the message character set to be one of the following:
• US-ASCII
• UTF-8
• ISO-8859-1
Message encoding now caters for :
• Base64 encoding
• Quoted-Printable (new)
Further, should the SMTP character set be UTF-8 or ISO-8859-1, user-encoding flag is not true and either Base64 or Quoted-Printable is defined as the character set, then the ‘subject’ content is now encoded appropriately to ensure correct formatting.
These changes are to facilitate multi-byte character sets as part of the SMTP subject and message.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 20 guests

cron