Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Uwe  
#1 Posted : Wednesday, October 26, 2022 4:45:17 AM(UTC)
Uwe

Rank: Newbie

Groups: Registered
Joined: 7/27/2022(UTC)
Posts: 5
Germany
Location: Altenstadt

Hi @All,

C++/MFC/MultiByte/EASendmail ActiveX

how do I handle oSmtp->Subject with German umlauts.
e.g.

CString strSubject = _T("Rückstandsliste"); // backorder list

oSmtp->HeaderEncoding = 1; // or 2
oSmtp->Subject = _bstr_t(strSubject);

the receiver get a "?" for the umlaut "ü"

how do I do it right ?

Thank you
-Uwe
ivan  
#2 Posted : Saturday, October 29, 2022 4:39:55 AM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,131

Thanks: 9 times
Was thanked: 50 time(s) in 50 post(s)
Try to use this and see if it will work, do you set Unicode charset in your project?
oSmtp->Subject = L"Rückstandsliste";

Uwe  
#3 Posted : Monday, October 31, 2022 7:11:10 AM(UTC)
Uwe

Rank: Newbie

Groups: Registered
Joined: 7/27/2022(UTC)
Posts: 5
Germany
Location: Altenstadt

Hello ivan,

I think I have come a little closer to the matter.

When I create a new mail, the encoder of EASenmail is called and the subject is coded correctly.

oSmtp->HeaderEncoding = 1;
oSmtp->AuthType = AuthXoauth2;
oSmtp->UserName = strKonto.AllocSysString();
oSmtp->Password = accessToken;
oSmtp->FromAddr = strFrom.AllocSysString();
oSmtp->ReplyTo = strReplyTo.AllocSysString();
oSmtp->Subject = strSubject.AllocSysString(); // _T("Rückstandsliste")
oSmtp->BodyText = strMailBody.AllocSysString();
Receiver see Subject: Rückstandsliste <----- ok

But if I load an existing mail with LoadMessage() and change the subject, , it seems that the encoder is not called.


oSmtp->LoadMessage(strEMLFile.AllocSysString()); <-------------- stored from EAGetMail
oSmtp->HeaderEncoding = 1;
oSmtp->AuthType = AuthXoauth2;
oSmtp->UserName = strKonto.AllocSysString();
oSmtp->Password = accessToken;
oSmtp->FromAddr = strFrom.AllocSysString();
oSmtp->ReplyTo = strReplyTo.AllocSysString();
oSmtp->Subject = strSubject.AllocSysString(); // _T("Rückstandsliste")
oSmtp->BodyText = strMailBody.AllocSysString();
Receiver see Subject: R?ckstandsliste <--------- failure

As a workaround, I use another encoder before assigning the subject.

easendmail_v7909
eagetmail_v5258
ActiveX

Thank you for your help

Greetings
-Uwe

Edited by user Monday, October 31, 2022 12:37:39 PM(UTC)  | Reason: wrong version of easendmail - corrected 7909 and 5258

ivan  
#4 Posted : Monday, October 31, 2022 4:22:54 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,131

Thanks: 9 times
Was thanked: 50 time(s) in 50 post(s)
Hi, please contact our support email address (support@emailarchitect.net) and send your eml file for assistance.

Additionally,
Code:

// this will cause memory leak.
oSmtp->Subject = strSubject.AllocSysString();

// please change it to:
BSTR bstrSubject = strSubject.AllocSysString();
oSmtp->Subject = bstrSubject;
::SysFreeString(bstrSubject);

Uwe  
#5 Posted : Tuesday, November 1, 2022 1:02:50 PM(UTC)
Uwe

Rank: Newbie

Groups: Registered
Joined: 7/27/2022(UTC)
Posts: 5
Germany
Location: Altenstadt

Hi ivan,

ups, thank you for the hint with AllocSysString. Much appreciated!

At the same time I send you some sample.eml with my observations about umlauts for your evaluation. If you have any further questions or something is missing, please contact me.

Many sincere thanks
-Uwe
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2022, Yet Another Forum.NET
This page was generated in 0.292 seconds.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.