1C:Enterprise getting e-mail texts via IMAP

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

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?

Edited: Murat Yazlıyev - Jan 10, 2017 05:53 AM
 
#2
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

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?

 
#3
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
#4
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

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.

Edited: Murat Yazlıyev - Jan 11, 2017 11:53 PM
 
#5
People who like this:1Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
#6
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

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.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.