Hello, I need to check e-mails and get their texts (messages). Below is my script. How to get e-mail text? I use 8.1 platform. Thank you in advance. Kris
Code
Profile = New InternetMailProfile;
Profile.User = User;
Profile.Password = Pass;
Profile...
MailBox = New InternetMail;
MailBox.Logon(Profile);
Mails = MailBox.Get(true);
If Mails.Count() > 0 Then
For each Mail in Mails Do
//here I need to get text of mail and process it line by line, how to do it?
EndDo;
EndIf;
Thank you Timofey for your help but I solved the problem this way:
Code
MailBox = New InternetMail;
MailBox.Logon(Profile);
Mails = MailBox.Get(true);
lp = 0;
If Mails.Count() > 0 Then
For each Mail in Mails Do
If Mail.Texts.Count() > 0 Then
For each Text in Mail.Texts Do
lp=lp+1;
Data = Text.Data;
Data.Write(SaveTempPath + "FileName"+String(lp)+".txt");
TextReader = New TextReader(SaveTempPath + "FileName"+String(lp)+".txt");
Str = TextReader.ReadLine();
While Str <> Undefined Do
Message(Str);
Str = TextReader.ReadLine();
EndDo;
EndDo;
EndIf;
EndDo;
EndIf;