Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > 1C:Enterprise getting e-mail texts via IMAP

Forum

Search UsersRules
1C:Enterprise getting e-mail texts via IMAP
#1
Interested
Points:: 0
Joined:: Apr 5, 2012

Hi,

We developed mail client in 1C:Enterprise plaform that sends and receives e-mailes via IMAP and SMTP.

About receiving an e-mail we have a little question. When we receive e-mail using InternetMail.GetHeaders() and then InternetMail.Get(...) methods, texts are received in array. Is there any idea why it's downloaded as array, not html text as a field?

Profile
#2
Interested
Points:: 0
Joined:: Apr 5, 2012

We wonder the algorithm of added array rows. In some mailes there only 1 row (plain text or html), in some mailes 2 rows (plain and html), in some mailes 3 rows (1 plain and 2 html or 2 plain and 1 html), in some mailes 4 rows ...

We wonder how platform addes rows in text array? How we should control it or show to user? Or how should we add the message if we want to reply it from ERP on 1C:Enterprise?

Profile
#3
Guest
Points::
Joined::

Hello, Murat!

According to the documentation, InternetMail.Get() returns an array of InternetMailMessage objects.

It returns not one text because there can be more than one message in the mailbox.

Profile
#4
Interested
Points:: 0
Joined:: Apr 5, 2012

Hi Timofey,

Firstly, wish perfect year in 2017.

To understand what I want to say prepared an example data processor that receives mailes and show you. Please see example.

Profile
#5
Guest
Points::
Joined::

Hello, Murat!

Thank you for the example and sorry for replying that late.

InternetMailTexts contain various formats of message. Most time it is 1 or 2 items and if you look at TextType property of its elements, you might notice that when there are 2 of them, they are often one of HTML type and another PlainText. So they are options of message that some email clients add to make messages readable on both: plain text and HTML recipient applications.

I could find only one message with 3 parts. And it was a message that Gmail collapses: first HTML part looked like a button with 3 dots in Gmail and the second part was the real message. Think, you should display to user all parts, but ones that before the last can be displayed collapsed. And if there is choice, prefer HTML to Plain text elements.

Hope, this helps.

Profile
#6
Interested
Points:: 0
Joined:: Apr 5, 2012

Thank you for your analyze of epf.

Second thanks for your opinion. We also think to get only html rows and show them in group logic etc. It was important to get your opinion as expert.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.