S
S
SpeakeazyYT22018-06-06 20:59:00
VBScript
SpeakeazyYT2, 2018-06-06 20:59:00

Problem with Russian words in VBS script?

Hello. There was a problem with the Russian words used in the script.
The code:

Option explicit
Dim oShell, Site, FromMail, ToMail, Subject, Message, Sender

Site = "1is.ru"
FromMail = "[email protected]"
ToMail = "[email protected]"
Subject = "Тест!"
Sender = "First Site"
Message = "Message!"

set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "telnet mx.yandex.ru 25"
WScript.Sleep 100
oShell.Sendkeys "helo "+(Site)
oShell.SendKeys "{ENTER}"
WScript.Sleep 100
oShell.Sendkeys "mail from:"+(FromMail)
oShell.SendKeys "{ENTER}"
WScript.Sleep 100
oShell.Sendkeys "rcpt to:"+(ToMail)
oShell.SendKeys "{ENTER}"
WScript.Sleep 100
oShell.Sendkeys "data"
oShell.SendKeys "{ENTER}"
WScript.Sleep 100
oShell.Sendkeys "from: "+(Sender)+" <"+(FromMail)+">"
oShell.SendKeys "{ENTER}"
oShell.Sendkeys "to: "+(ToMail)
oShell.SendKeys "{ENTER}"
oShell.Sendkeys "subject: "+(Subject)
oShell.SendKeys "{ENTER}"
oShell.SendKeys "{ENTER}"
oShell.Sendkeys (Message)
oShell.SendKeys "{ENTER}"
oShell.Sendkeys "."
oShell.SendKeys "{ENTER}"
WScript.Sleep 1000
oShell.SendKeys "quit"
oShell.SendKeys "{ENTER}"

The problem arises in the Subject variable, the value of which is the Russian word "Test". When you run the script in the console, the commands are converted to krakozyabry. Screenshots below!
***If you use the word in English, then everything is fine. -> https://imgur.com/a/9upi8oz
****If you use the word in Russian, then there will be bugs in the console for the commands that are executed in this script. -> https://imgur.com/a/VWS6u6v
How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question