Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMTP and russian language

0 views
Skip to first unread message

meg...@gmail.com

unread,
Aug 30, 2006, 5:58:54 PM8/30/06
to
Hi! I want send mail and i have question

When i wrote message on Russian
"Привет"

But i received:
@825B

Maybe you know why i had it?

Thank you

Michael Schlenker

unread,
Aug 30, 2006, 6:36:56 PM8/30/06
to
meg...@gmail.com schrieb:

Show us the code you used..., its likely some encoding trouble somewhere
during processing.

Also take a look at the full headers of the received mail or even better
the raw mime data, which may give you hints what encoding the mail is
in. It could be that you send koi-8 but receive some unicode variant or
vice versa.

Michael

meg...@gmail.com

unread,
Aug 31, 2006, 4:09:08 AM8/31/06
to
I changed
set token [mime::initialize -canonical text/plain -string
"Привет"]
to
set token [mime::initialize -canonical text/plain -string [encoding
convertto "Привет"]]
and all ok
but i don't know why :(

Michael Schlenker

unread,
Aug 31, 2006, 6:59:08 AM8/31/06
to
meg...@gmail.com schrieb:

You should simply cut and copy working code and we could tell you...,
those above is missing the critical info (the first argument to encoding
convertto].

Encoding handling for mime is a bit more complex, afaik you need some
kind of header to indicate your not sending US ASCII...

Michael

meg...@gmail.com

unread,
Aug 31, 2006, 10:51:37 AM8/31/06
to
This is working code:

set token [mime::initialize -canonical text/plain -string [encoding
convertto "Привет"]

set args [list -debug 0 -usetls 0 \
-servers "$server" -header [list From $sms_opt::smtpmail] \
-header [list Date $date] -header [list To $to] -header [list
Subject ""]]
if {[string length $login]} {lappend args -username $login}
if {[string length $pass]} {lappend args -password $pass}
if {[string length $port]} {lappend args -ports $port}
if {[catch {eval [linsert $args 0 smtp::sendmessage $token]} err]} {
tk_messageBox -message "$err" -title Error -icon error
}
mime::finalize $token

Thi is headers of mail:

MIME-Version: 1.0
Content-ID: <1344.1157011467.1@comp>
From: xxx
Date: Thu, 31 Aug 2006 12:04:27
To: xxx
Subject:
Message-ID: <1344.1157011467.2@comp>
Content-Type: text/plain

Darren New

unread,
Aug 31, 2006, 1:05:13 PM8/31/06
to
meg...@gmail.com wrote:
> Content-Type: text/plain

You probably want to specify a charset=... on this line, as per the MIME
standards, to say what character set you are sending.

--
Darren New / San Diego, CA, USA (PST)
This octopus isn't tasty. Too many
tentacles, not enough chops.

0 new messages