Скачать все E-Mail сообщения и отправить их содержимое в Telegram

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
Товарищи, помогите, пожалуйста, решить вопрос.

Задача:
каждый час вытаскивать сообщения с почты и отправлять их в Telegram канал

Как отправить в Telegram канал я понимаю, а вот с почтой есть проблемки.

Есть код:
C#:
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload(project.Variables["Email_login"].Value, 
       project.Variables["Email_password"].Value, project.Variables["Email_server"].Value, Convert.ToInt32(project.Variables["Email_port"].Value), true,
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.IMAP, 
       24*100, 200, false);
 

foreach(Tuple<string, string, string, string> tuple in allMails)
{
    project.Lists["List"].Add(tuple.Item4);
}
К сожалению, в результате выводятся одни кракозябры даже без присутствия текста сообщения
Return-Path: <RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com>
Delivered-To: [email protected]
Received: from DIR-03 ([10.20.147.193]) by IMAP-20 with LMTP id jZp0IX6yYF7iUgAALEJ/og (envelope-from <RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com>) for <[email protected]>; Thu, 05 Mar 2020 03:04:14 -0500
Received: from MTA-01.privateemail.com ([10.20.147.11]) by DIR-03 with LMTP id YFwoIH6yYF58QgAAtNLlyA (envelope-from <RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com>) for <[email protected]>; Thu, 05 Mar 2020 03:04:14 -0500
Received: from oxse3.privateemail.com (unknown [10.20.151.227]) by MTA-01.privateemail.com (Postfix) with ESMTP id 8295E60188 for <[email protected]>; Thu, 5 Mar 2020 08:04:14 +0000 (UTC)
Received: from a13-39.smtp-out.amazonses.com ([54.240.13.39]) by oxse3.privateemail.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-SHA256:128-) (Exim 4.92) (envelope-from <RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com>) id 1j9lUL-0009f4-4K for [email protected]; Thu, 05 Mar 2020 00:04:14 -0800
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=jvxsykglqiaiibkijmhy37vqxh4mzqr6; d=amazon.com; t=1583395451; h=From:Reply-To:To:Message-ID:Subject:MIME-Version:Content-Type:Date; bh=g3kM4XCJzYsdbNHciA9+SfAYRCGbrtRBOsagVvZPIuA=; b=Tvjm9DquiMkn/pvBOs/7A3mYd99omPTx+TPJ1+gBku0/pLBKfyxqPATfVdVsZLkw W15IZ7WMC/lUvZn5P2JP6oixSdFWJmSMtn/UHnyZ8ZO3L8IHDJ6lK+ZjhD3MK4dPK+F QT725S7le9JWAV6MaDP/QxBatm2XdmdDzVm9MNvw=
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1583395451; h=From:Reply-To:To:Message-ID:Subject:MIME-Version:Content-Type:Date:Feedback-ID; bh=g3kM4XCJzYsdbNHciA9+SfAYRCGbrtRBOsagVvZPIuA=; b=JOfqfb3vC1sHvic/GVUgtLVz3oTjW2DJafhffk7dsURCd2fJWdNjNHVUJmn6PKwX BquoYpcIZ77NIzGQtzFTE9L6r2Qd6eOeLxiA1pBYpiiWbER1IZJfkWstmmLZvMB1hXt 1OlgKBbz99lcLb/MxHCH9Jckb7shseAt3AA/nZr8=
From: "Amazon.com" <[email protected]>
Reply-To: "Amazon.com" <[email protected]>
To: [email protected]
Message-ID: <01000170a9b93308-1ca36956-cfa8-4485-9289-ba8675c86b14-000000@email.amazonses.com>
Subject: Your message to a buyer could not be delivered
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_44077289_1208178605.1583395451627"
X-AMAZON-MAIL-RELAY-TYPE: notification
Bounces-to: RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com
X-AMAZON-METADATA: CA=C2J1N6Q7SNDN5Q-CU=A2EF6I3ANO8E3M
X-Original-MessageID: <urn.rtn.msg.202003050804110179a39b08794bfcaeb413f54c60p0na@1583395451628.rtn-svc-na-back-c42xl1f-39db918b.us-east-1.amazon.com>
Date: Thu, 5 Mar 2020 08:04:11 +0000
X-SES-Outgoing: 2020.03.05-54.240.13.39
Feedback-ID: 1.us-east-1.ZHcGJK6s+x+i9lRHKog4RW3tECwWIf1xzTYCZyUaiec=:AmazonSES
Received-SPF: pass (oxse3.privateemail.com: domain of sellernotifications.amazon.com designates 54.240.13.39 as permitted sender) client-ip=54.240.13.39; envelope-from=RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com; helo=a13-39.smtp-out.amazonses.com;
X-SPF-Result: oxse3.privateemail.com: domain of sellernotifications.amazon.com designates 54.240.13.39 as permitted sender
Authentication-Results: oxse3.privateemail.com; iprev=pass (a13-39.smtp-out.amazonses.com) smtp.remote-ip=54.240.13.39; spf=pass smtp.mailfrom=sellernotifications.amazon.com; dkim=pass header.d=amazon.com header.s=jvxsykglqiaiibkijmhy37vqxh4mzqr6 header.a=rsa-sha256; dkim=pass header.d=amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.a=rsa-sha256; dmarc=pass header.from=amazon.com
Authentication-Results: privateemail.com; spf=pass smtp.mailfrom=RTE+NE-null-de34cA04355481ERSCRWSVUFAV@sellernotifications.amazon.com; dkim=pass header.i=amazon.com; dkim=pass header.i=amazonses.com
X-SpamExperts-Class: ham
X-SpamExperts-Evidence: urlwl/url-14.rbl.spamrl.com
X-Recommended-Action: accept
X-Filter-ID: 8G1aH+8yearZuN6N5+X5bm6KuAmzEgFjeXz34jnHp0xpaawAQLCw41DX+7uxKx0P2LDkrRcqyp/p /iw75DwQ0G8XO88BGELJmwiCIfZy97JMnxyxvOAWf1AnBf0oKo/bpD0ERTK54oGKVJxRKL9desDr y1ZYERqFs5HETSF8mWoEbKnrbmfykUlIBhdxUA5Avlu7+ZSR1mpPI6X4cK31Z9onlp5/4ne0l2aZ 5YMMArBQJq4CAvbEhriy8YR+VObscg5lykP5wG4Mmz8nUjOS8DhdroYXYi0/fPk5xrjbO/e3jXp9 y/CRqJ0fp+/ItSCMRN/TIbaAhQUr9KTsheuxefnstWznVxULZM6N1eUuevUB15eMIME6iZU0/33r c4pTBldNoc4/ugpbufbubK+x4pGqVAT1vWFeEhEnVslbRXVRh+7MnWbw7fXOUdDwPDg2/oSCEqKd M8nR/Svu6t2/d2FgOK8gW+hazh84oBeMtGHddCtZkiJhYB+pTB588WIEu9crOn4hxUDoCtxlVUDr djzpUJKkpn+6O1ClABB6qX+FhVB3l9iJsAD3yZ0NDdUGqJJCVZlKfZUV1+cyiSJF/TkG1ZLqKZoV WsO3GXR1NfY93SsS4aMXJmiJ2G0eb5ahc309kJlrtiQADK1D5C/MGAgLgOHHycpqPHQOVWkrD6Od 6+6AB9mEpRX5vy67WwDjehIqUczFWeS6sE8e1b5/UnHGgI7xQfcqGQRmHKqI721J2Aalii9Py0Xe pqFzGmMacxw3qqhc+N6cuEg4XWh5FjGyGwpmDDBIehyodbYnDbdw/h7ywQVNzONF0LW3MF7LlWgF eiCw/xjAZS5uL9JaEbsXekgMiWvYq5wOzcFeG65kAdNlXXVy2MxRt21KEErK4Yh+QMpSjplFH+iW 602tWFvxDejqc1gSvA2YxCROcMJblIU/MdxUqt2tzIbp3553nB3WTnFQjjXfA7dqDLEdZHSXngiL eVYPZULbBZlVtNm1jPjDviYpVeR1WyyqQWWIXPWlFdaGOH191uXjgjQN/VIyUvwyQVTtnONHY+SM 6q79+R2kzkuwI0hbsBhK4dLptxIThUDY/EYrVfNtrkz+rYbiqrebmfBhZWKoI58/X6WqYI5B9DQw CoLgvrdCbeu7eAdqdT/Sr+3QCgzUKsjoYWQaBLOXOFc/TFs0yta1RigWfpirH8g1GOR1IFGt5BWm
X-Report-Abuse-To: [email protected]
ckx-imap-internaldate: 05-Mar-2020 03:04:14 -0500
ckx-imap-uid: 11
ckx-imap-isUid: NO
ckx-imap-seen: YES
ckx-imap-answered: NO
ckx-imap-deleted: NO
ckx-imap-flagged: NO
ckx-imap-draft: NO
ckx-imap-flags: \Seen

При этом, если указывать вывод html содержимого сообщения через Add(tuple.Item3); получаю огромный html кусок после текста выше из которого проблематично выдернуть реальный текст.

Подскажите, пожалуйста, совсем не бум-бум :(
 

Phoenix78

Client
Read only
Регистрация
06.11.2018
Сообщения
11 790
Благодарностей
5 694
Баллы
113

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
Item4 попробовал +
Item3 попробовал +
Item2 -
Item1 -
ну надо быть последовательным :-)
в Item2 лежит текст
Спасибо. Только в Item2 лежит не текст, а отправитель письма, я пробовал все четыре :-)
55791
 
Последнее редактирование:

Phoenix78

Client
Read only
Регистрация
06.11.2018
Сообщения
11 790
Благодарностей
5 694
Баллы
113
Спасибо. Только в Item2 лежит не текст, а отправитель письма, я пробовал все четыре :-)
вот надыбал
// tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
точно Item4 текст :-) а Item2 заголовок.
если текста нет, значит надо дергать из html
с помощью регулярок или xpath можно до гланд достать через одно темное место :-)
 
  • Спасибо
Реакции: AMZWIN

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
вот надыбал
// tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
точно Item4 текст :-) а Item2 заголовок.
если текста нет, значит надо дергать из html
с помощью регулярок или xpath можно до гланд достать через одно темное место :-)
Я подозревал, проблема в том, что разные тела сообщений + не везде может быть такой запутанный html, или под каждый шаблон сообщения нужно писать регулярку?
Да и я не силён в этом, увы :(

<!-- Email Body -->
<body style="body" >
<center class="wrapper" style="width:100%;table-layout:fixed;background-color:#e4e3e4;" >
<div class="webkit" style="max-width:600px;margin:0 auto;" >
<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="border-collapse:collapse;height:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;width:100%;background-color:#e4e3e4;color:#5a5a5a;font-family:'Lato', Helvetica, Arial, sans-serif;" >
<tr>
<td align="center" valign="top" id="bodyCell" style="height:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;width:100%;padding-top:10px;padding-bottom:10px;border-top-width:0;" >
<!-- BEGIN TEMPLATE // -->
<!--[if (gte mso 9)|(IE)]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;border-collapse:collapse;" >
<tr>
<td align="center" valign="top" width="600" style="width:600px;" >
<![endif]-->
<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" style="width:100%;max-width:600px;border-collapse:collapse;" >
<tr>
<td>
<!-- Previewtext - Optional content - This text will appear in the inbox preview, but not the email body. div class = "preview-text" -->
<div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;">
We were unable to deliver the message you sent to Stephen Chase Smith for order 113-4746917-2184756 because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
</div>
<!-- Included header file(graphics) -->
<!-- BLOCK Logo Center -->
<table class="one-column" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing:0;">
<tr valign="top" style="border-top-width:0;border-bottom-width:0;font-size:14px;line-height:185%;text-align:left;" >
<td valign="top" class="templateLowerBody" style="background-color:#2a323a;" >
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextBlock" style="min-width:100%;border-collapse:collapse;background-color:#2a323a;" bgcolor="#2a323a">
<tbody class="endrTextBlockOuter">
<tr>
<td valign="top" class="endrTextBlockInner">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextContentContainer" style="min-width:100%;border-collapse:collapse;"bgcolor="#2a323a">
<tbody>
<tr>
<td class="templateHeader" valign="top" style = "padding: 20px 0; padding-left:40px">
<img align="center" alt="" src="http://g-ecx.images-amazon.com/images/G/01/tmtdefaulttemplate/img/logo-selling_coach.png" width="200" style="max-width:200px;padding-bottom:0;display:inline !important;vertical-align:bottom;border-width:0;height:auto;outline-style:none;text-decoration:none;-ms-interpolation-mode:bicubic;" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table><!-- ENDR Header -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" width="100%" style="width:100%;max-width:600px;border-collapse:collapse;background-color:#ffffff;" bgcolor="#ffffff" >
<tr>
<td>
<!-- General Block of text - modify/replace with your content -->
<table class="one-column">
<tr valign="top" class="templateBlocks">
<td valign="top">
<table class="endrTextBlock">
<tbody class="endrTextBlockOuter">
<tr>
<td valign="top" class="endrTextBlockInner">
<table align="left" class="endrTextContentContainer">
<tbody>
<tr>
<td class="endrTextContent" align="center" valign="top">

<h1>
<p style="font-size: 14px; font-weight: 300; text-align: start;">Dear Seller,</p>
<p style="font-size: 14px; font-weight: 300; text-align: start;">
<span style="background-color: rgb(229, 229, 229); color: inherit;"></span>
</p>


<p style="font-size: 14px; font-weight: 300; text-align: start;">We were unable to deliver the message you sent to Stephen Chase Smith on 2020-05-14 for order [113-4746917-2102618] because the buyer has chosen to opt out of receiving unsolicited messages from sellers.</p>
<p style="font-size: 14px; font-weight: 300; text-align: start;"><span style="background-color: rgb(229, 229, 229); color: inherit;"></span></p>

<p style="font-size: 14px; font-weight: 300; text-align: start;">However, even if a buyer has opted out of unsolicited messages, if you need to send them a message critical to completing his or her order, you can include the word [Important] in the subject of your <a href="mailto:[email protected]?subject= [Important]">e-mail to the buyer</a> or use the Buyer-Seller Messaging interface on Seller Central:</p>
<ol style="font-size: 14px; font-weight: 300; text-align: start;">
<li>Go to&nbsp;<a href="https://sellercentral.amazon.com/nms/sellermobile/redirect/e251fc43-efd0-3a24-9d82-40300e01ad9c?sk=MiE0xAncjhE6M-Gb8hY53yTsGGSPL4rswhd9Cc4HU91gG6OV7TUwjfXRl58j5FVaH-8OglvM7yoLi5LNkXF3dQ&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3Avb3JkZXJzLXYyL2xpc3Q">Manage Orders</a>.</li>
<li>Click the buyer’s name in the list, which will take you to&nbsp;<a href= "https://sellercentral.amazon.com/nms/redirect/7e587a45-329c-3c9d-9181-e21d0615d9f7?sk=8ftEDfFCXFywKer-i5VZb4tMvW7bVNKIJaM1a67CFGEyk2XkiWs_fyiFLHhd-1dng9y9uFyk7oBV7-O1JZ4sbQ&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3AvaGVscC8yMDAzODkwODA">Buyer-Seller Messaging</a>.</li>
<li>Select "Additional Information Required" as your subject, write your message, and click&nbsp;<span style="font-weight: 700;">Send</span></li>
</ol>

<p style="font-size: 14px; font-weight: 300; text-align: start;">If you tried to respond to a buyer and received a message that the buyer has opted out of unsolicited seller messages, please respond to the buyer on the original message thread (instead of starting a new thread) and make sure that his or her original message is included in your reply.</p>

<p style="font-size: 14px; font-weight: 300; text-align: start;">For your reference, the following messages are considered “critical” to complete the order:</p>
<ul style="font-size: 14px; font-weight: 300; text-align: start;">
<li>Product customization questions</li>
<li>Delivery scheduling</li>
<li>Issues with a shipping address</li>
</ul>
<p style="font-size: 14px; font-weight: 300; text-align: start;">The following messages are “not critical” to complete the order:</p>
<ul style="font-size: 14px; font-weight: 300; text-align: start;">
<li>Requests for seller feedback or customer reviews</li>
<li>Order, shipment, or delivery confirmations</li>
<li>Proactive customer service (for example: product manuals, tips for using the product, FAQs, suggestions if something goes wrong)</li>
<li>Out-of-stock or delay notifications and offers of alternate products (please cancel the order instead)</li>
</ul>

<p style="font-size: 14px; font-weight: 300; text-align: start;">Learn more about&nbsp;<a href="https://sellercentral.amazon.com/nms/redirect/7e587a45-329c-3c9d-9181-e21d0615d9f7?sk=8ftEDfFCXFywKer-i5VZb4tMvW7bVNKIJaM1a67CFGEyk2XkiWs_fyiFLHhd-1dng9y9uFyk7oBV7-O1JZ4sbQ&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3AvaGVscC8yMDAzODkwODA">Buyer-Seller Messaging</a>&nbsp;and what messages are considered critical to completing orders.</p>

<p style="font-size: 14px; font-weight: 300; text-align: start;">Sincerely,</p><p style="font-size: 14px; font-weight: 300; text-align: start;">Amazon Seller Support</p>
</h1>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- Footer -->
<!-- Included footer file, can be cloned and/or replaced. -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="width:100%;max-width:600px;border-collapse:collapse;background-color:#2a323a;" bgcolor="#2a323a" >
<tr>
<td>
<!-- BLOCK Separator Color -->
<table class="one-column" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing:0;background-color:#2a323a;" bgcolor="#2a323a">
<tr valign="top" style="border-top-width:0;border-bottom-width:0;padding-top:0;padding-bottom:0;" >
<td valign="top" style="font-size:20px;line-height:20px;background-color:#e4e3e4;" height="10" >&nbsp;

</td>
</tr>
</table>
<!-- BLOCK Separator Color -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" width="100%" style="width:100%;max-width:600px;border-collapse:collapse;background-color:#ffffff;" bgcolor="#ffffff" >
<tr>
<td>

Дальше бесполезный контент в письме, он присутствует во многих письмах (далеко не во всех) в конце
<!-- BLOCK Footer About Us -->
<table class="one-column" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing:0;">
<tr valign="top" style="border-top-width:0;border-bottom-width:0;font-size:14px;line-height:185%;text-align:left;" >
<td valign="top" class="templateLowerBody" style="background-color:#2a323a;" >
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextBlock" style="min-width:100%;border-collapse:collapse;background-color:#2a323a;" bgcolor="#2a323a">
<tbody class="endrTextBlockOuter">
<tr>
<td valign="top" class="endrTextBlockInner">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextContentContainer" style="min-width:100%;border-collapse:collapse;"bgcolor="#2a323a">
<tbody>
<tr>

<center><font color="white"><a href="https://sellercentral.amazon.com/nms/redirect/492ce435-07c7-3afc-b408-b52b922cbc23?sk=uxKne2y48AbJD_osnzjRo03I6ACZRlcvGT6JKWeOJ8QIojS3rpApwKJWnav70luyeS8xIDJ-qA_M9UoNaiS_Dw&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3Avc2F0aXNmYWN0aW9uL3N1cnZleS1mb3JtLmh0bWw_aWU9VVRGOCZITUROYW1lPU5vdGlmaWNhdGlvbkJ1c0VtYWlsSE1EJmN1c3RvbUF0dHJpYnV0ZTFWYWx1ZT1CVVlFUl9PUFRFRF9PVVRfQlNNX01FU1NBR0VT" class="nbus-survey">Was this email helpful?
</a></font></center>
<p style="text-align:center !important;margin-top:10px;margin-bottom:10px;margin-right:10px;margin-left:15px;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;color:#ffffff;font-family:'Lato', Helvetica, Arial, sans-serif;font-size:13px;line-height:150%;">If you have any questions visit: <a href="https://sellercentral.amazon.com/nms/sellermobile/redirect/8ac614b3-bc1f-3a9c-8213-eec4b9a7c787?sk=xTou3zx0Tcc17QvwkTPyoXzsVnU328jwyrszOtCD1vVeYISfM65Nzd5K58oqp4HWVC6o3hb4tpxHpT_hD3spvw&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20" metric="help" style="text-decoration: none; color: #ffffff;">Seller Central</a><br/><br/>
To change your email preferences visit: <a href="https://sellercentral.amazon.com/nms/redirect/b7bf43e3-9ab0-38fa-bcf2-8bd28e5d65f1?sk=Rl-N6KEFiEIkoqpShsuIV4Z4xndMxQTKVTyvzBEiVEeVQ3qkfWCoSZLoy7_MIhO61gw14To8Z7-8NM-20-MUSw&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vbm90aWZpY2F0aW9ucy9wcmVmZXJlbmNlcy9yZWY9aWRfbm90aWZwcmVmX2RuYXZfeHhf" metric="optout" style="text-decoration: none; color: #ffffff;">Notification Preferences</a><br/><br/>
We hope you found this message to be useful. However, if you'd rather not receive future e-mails of this sort from Amazon.com, please opt-out <a href="https://sellercentral.amazon.com/nms/redirect/c81fa8dc-eb85-3604-844c-cd8f96d1976d?sk=ZEokAhyEKkNGzxCCJLnrboNeg-vJQQKCzyZnGhMOkDKKh8eurfb6kj5tzkXbSQ1DFuxK51YnKDZD2i2OCVZohA&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vbm90aWZpY2F0aW9ucy9wcmVmZXJlbmNlcy9vcHRvdXQ_b3B0b3V0SWQ9YWNiZDZjNzgtOWE4YS00NzM3LWE0Y2ItYjQwOGZmYmZmM2Rj" metric="optout" style="text-decoration: none; color: #ffffff;">here.</a><br/><br/>
Copyright 2020 Amazon, Inc, or its affiliates. All rights reserved.<br/>
Amazon.com, 410 Terry Avenue North, Seattle, WA 98109-5210<br/></p>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- BLOCK Footer About Us -->
</td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" style="width:100%;max-width:600px;border-collapse:collapse;" >
<tr>
<td>

</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
<!-- // END TEMPLATE -->
</td>
</tr>
</table><!-- Footer -->
<img src="https://sellercentral.amazon.com/nms/img/0f79f1b8-df77-35f0-a34e-b162c10f4875?sk=z9oMkEy-GLi5a6LyM6eC0Pc60RaGbZ1II-ytwDcXmVfdv5_HX-WjM4iIjNB1zBwoiegHmLAP_rsa8_oENttEEw&amp;n=1" height="1" width="1" border="0" alt=""></body>
</html>
 

Phoenix78

Client
Read only
Регистрация
06.11.2018
Сообщения
11 790
Благодарностей
5 694
Баллы
113
Я подозревал, проблема в том, что разные тела сообщений + не везде может быть такой запутанный html, или под каждый шаблон сообщения нужно писать регулярку?
Да и я не силён в этом, увы :(

<!-- Email Body -->
<body style="body" >
<center class="wrapper" style="width:100%;table-layout:fixed;background-color:#e4e3e4;" >
<div class="webkit" style="max-width:600px;margin:0 auto;" >
<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="border-collapse:collapse;height:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;width:100%;background-color:#e4e3e4;color:#5a5a5a;font-family:'Lato', Helvetica, Arial, sans-serif;" >
<tr>
<td align="center" valign="top" id="bodyCell" style="height:100%;margin-top:0;margin-bottom:0;margin-right:0;margin-left:0;width:100%;padding-top:10px;padding-bottom:10px;border-top-width:0;" >
<!-- BEGIN TEMPLATE // -->
<!--[if (gte mso 9)|(IE)]>
<table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;border-collapse:collapse;" >
<tr>
<td align="center" valign="top" width="600" style="width:600px;" >
<![endif]-->
<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" style="width:100%;max-width:600px;border-collapse:collapse;" >
<tr>
<td>
<!-- Previewtext - Optional content - This text will appear in the inbox preview, but not the email body. div class = "preview-text" -->
<div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;">
We were unable to deliver the message you sent to Stephen Chase Smith for order 113-4746917-2184756 because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
</div>
<!-- Included header file(graphics) -->
<!-- BLOCK Logo Center -->
<table class="one-column" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing:0;">
<tr valign="top" style="border-top-width:0;border-bottom-width:0;font-size:14px;line-height:185%;text-align:left;" >
<td valign="top" class="templateLowerBody" style="background-color:#2a323a;" >
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextBlock" style="min-width:100%;border-collapse:collapse;background-color:#2a323a;" bgcolor="#2a323a">
<tbody class="endrTextBlockOuter">
<tr>
<td valign="top" class="endrTextBlockInner">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextContentContainer" style="min-width:100%;border-collapse:collapse;"bgcolor="#2a323a">
<tbody>
<tr>
<td class="templateHeader" valign="top" style = "padding: 20px 0; padding-left:40px">
<img align="center" alt="" src="http://g-ecx.images-amazon.com/images/G/01/tmtdefaulttemplate/img/logo-selling_coach.png" width="200" style="max-width:200px;padding-bottom:0;display:inline !important;vertical-align:bottom;border-width:0;height:auto;outline-style:none;text-decoration:none;-ms-interpolation-mode:bicubic;" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table><!-- ENDR Header -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" width="100%" style="width:100%;max-width:600px;border-collapse:collapse;background-color:#ffffff;" bgcolor="#ffffff" >
<tr>
<td>
<!-- General Block of text - modify/replace with your content -->
<table class="one-column">
<tr valign="top" class="templateBlocks">
<td valign="top">
<table class="endrTextBlock">
<tbody class="endrTextBlockOuter">
<tr>
<td valign="top" class="endrTextBlockInner">
<table align="left" class="endrTextContentContainer">
<tbody>
<tr>
<td class="endrTextContent" align="center" valign="top">

<h1>
<p style="font-size: 14px; font-weight: 300; text-align: start;">Dear Seller,</p>
<p style="font-size: 14px; font-weight: 300; text-align: start;">
<span style="background-color: rgb(229, 229, 229); color: inherit;"></span>
</p>


<p style="font-size: 14px; font-weight: 300; text-align: start;">We were unable to deliver the message you sent to Stephen Chase Smith on 2020-05-14 for order [113-4746917-2102618] because the buyer has chosen to opt out of receiving unsolicited messages from sellers.</p>
<p style="font-size: 14px; font-weight: 300; text-align: start;"><span style="background-color: rgb(229, 229, 229); color: inherit;"></span></p>

<p style="font-size: 14px; font-weight: 300; text-align: start;">However, even if a buyer has opted out of unsolicited messages, if you need to send them a message critical to completing his or her order, you can include the word [Important] in the subject of your <a href="mailto:[email protected]?subject= [Important]">e-mail to the buyer</a> or use the Buyer-Seller Messaging interface on Seller Central:</p>
<ol style="font-size: 14px; font-weight: 300; text-align: start;">
<li>Go to&nbsp;<a href="https://sellercentral.amazon.com/nms/sellermobile/redirect/e251fc43-efd0-3a24-9d82-40300e01ad9c?sk=MiE0xAncjhE6M-Gb8hY53yTsGGSPL4rswhd9Cc4HU91gG6OV7TUwjfXRl58j5FVaH-8OglvM7yoLi5LNkXF3dQ&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3Avb3JkZXJzLXYyL2xpc3Q">Manage Orders</a>.</li>
<li>Click the buyer’s name in the list, which will take you to&nbsp;<a href= "https://sellercentral.amazon.com/nms/redirect/7e587a45-329c-3c9d-9181-e21d0615d9f7?sk=8ftEDfFCXFywKer-i5VZb4tMvW7bVNKIJaM1a67CFGEyk2XkiWs_fyiFLHhd-1dng9y9uFyk7oBV7-O1JZ4sbQ&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3AvaGVscC8yMDAzODkwODA">Buyer-Seller Messaging</a>.</li>
<li>Select "Additional Information Required" as your subject, write your message, and click&nbsp;<span style="font-weight: 700;">Send</span></li>
</ol>

<p style="font-size: 14px; font-weight: 300; text-align: start;">If you tried to respond to a buyer and received a message that the buyer has opted out of unsolicited seller messages, please respond to the buyer on the original message thread (instead of starting a new thread) and make sure that his or her original message is included in your reply.</p>

<p style="font-size: 14px; font-weight: 300; text-align: start;">For your reference, the following messages are considered “critical” to complete the order:</p>
<ul style="font-size: 14px; font-weight: 300; text-align: start;">
<li>Product customization questions</li>
<li>Delivery scheduling</li>
<li>Issues with a shipping address</li>
</ul>
<p style="font-size: 14px; font-weight: 300; text-align: start;">The following messages are “not critical” to complete the order:</p>
<ul style="font-size: 14px; font-weight: 300; text-align: start;">
<li>Requests for seller feedback or customer reviews</li>
<li>Order, shipment, or delivery confirmations</li>
<li>Proactive customer service (for example: product manuals, tips for using the product, FAQs, suggestions if something goes wrong)</li>
<li>Out-of-stock or delay notifications and offers of alternate products (please cancel the order instead)</li>
</ul>

<p style="font-size: 14px; font-weight: 300; text-align: start;">Learn more about&nbsp;<a href="https://sellercentral.amazon.com/nms/redirect/7e587a45-329c-3c9d-9181-e21d0615d9f7?sk=8ftEDfFCXFywKer-i5VZb4tMvW7bVNKIJaM1a67CFGEyk2XkiWs_fyiFLHhd-1dng9y9uFyk7oBV7-O1JZ4sbQ&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3AvaGVscC8yMDAzODkwODA">Buyer-Seller Messaging</a>&nbsp;and what messages are considered critical to completing orders.</p>

<p style="font-size: 14px; font-weight: 300; text-align: start;">Sincerely,</p><p style="font-size: 14px; font-weight: 300; text-align: start;">Amazon Seller Support</p>
</h1>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- Footer -->
<!-- Included footer file, can be cloned and/or replaced. -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="width:100%;max-width:600px;border-collapse:collapse;background-color:#2a323a;" bgcolor="#2a323a" >
<tr>
<td>
<!-- BLOCK Separator Color -->
<table class="one-column" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing:0;background-color:#2a323a;" bgcolor="#2a323a">
<tr valign="top" style="border-top-width:0;border-bottom-width:0;padding-top:0;padding-bottom:0;" >
<td valign="top" style="font-size:20px;line-height:20px;background-color:#e4e3e4;" height="10" >&nbsp;

</td>
</tr>
</table>
<!-- BLOCK Separator Color -->
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" width="100%" style="width:100%;max-width:600px;border-collapse:collapse;background-color:#ffffff;" bgcolor="#ffffff" >
<tr>
<td>

Дальше бесполезный контент в письме, он присутствует во многих письмах (далеко не во всех) в конце
<!-- BLOCK Footer About Us -->
<table class="one-column" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-spacing:0;">
<tr valign="top" style="border-top-width:0;border-bottom-width:0;font-size:14px;line-height:185%;text-align:left;" >
<td valign="top" class="templateLowerBody" style="background-color:#2a323a;" >
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextBlock" style="min-width:100%;border-collapse:collapse;background-color:#2a323a;" bgcolor="#2a323a">
<tbody class="endrTextBlockOuter">
<tr>
<td valign="top" class="endrTextBlockInner">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" class="endrTextContentContainer" style="min-width:100%;border-collapse:collapse;"bgcolor="#2a323a">
<tbody>
<tr>

<center><font color="white"><a href="https://sellercentral.amazon.com/nms/redirect/492ce435-07c7-3afc-b408-b52b922cbc23?sk=uxKne2y48AbJD_osnzjRo03I6ACZRlcvGT6JKWeOJ8QIojS3rpApwKJWnav70luyeS8xIDJ-qA_M9UoNaiS_Dw&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vZ3Avc2F0aXNmYWN0aW9uL3N1cnZleS1mb3JtLmh0bWw_aWU9VVRGOCZITUROYW1lPU5vdGlmaWNhdGlvbkJ1c0VtYWlsSE1EJmN1c3RvbUF0dHJpYnV0ZTFWYWx1ZT1CVVlFUl9PUFRFRF9PVVRfQlNNX01FU1NBR0VT" class="nbus-survey">Was this email helpful?
</a></font></center>
<p style="text-align:center !important;margin-top:10px;margin-bottom:10px;margin-right:10px;margin-left:15px;padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;color:#ffffff;font-family:'Lato', Helvetica, Arial, sans-serif;font-size:13px;line-height:150%;">If you have any questions visit: <a href="https://sellercentral.amazon.com/nms/sellermobile/redirect/8ac614b3-bc1f-3a9c-8213-eec4b9a7c787?sk=xTou3zx0Tcc17QvwkTPyoXzsVnU328jwyrszOtCD1vVeYISfM65Nzd5K58oqp4HWVC6o3hb4tpxHpT_hD3spvw&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20" metric="help" style="text-decoration: none; color: #ffffff;">Seller Central</a><br/><br/>
To change your email preferences visit: <a href="https://sellercentral.amazon.com/nms/redirect/b7bf43e3-9ab0-38fa-bcf2-8bd28e5d65f1?sk=Rl-N6KEFiEIkoqpShsuIV4Z4xndMxQTKVTyvzBEiVEeVQ3qkfWCoSZLoy7_MIhO61gw14To8Z7-8NM-20-MUSw&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vbm90aWZpY2F0aW9ucy9wcmVmZXJlbmNlcy9yZWY9aWRfbm90aWZwcmVmX2RuYXZfeHhf" metric="optout" style="text-decoration: none; color: #ffffff;">Notification Preferences</a><br/><br/>
We hope you found this message to be useful. However, if you'd rather not receive future e-mails of this sort from Amazon.com, please opt-out <a href="https://sellercentral.amazon.com/nms/redirect/c81fa8dc-eb85-3604-844c-cd8f96d1976d?sk=ZEokAhyEKkNGzxCCJLnrboNeg-vJQQKCzyZnGhMOkDKKh8eurfb6kj5tzkXbSQ1DFuxK51YnKDZD2i2OCVZohA&amp;n=1&amp;u=aHR0cHM6Ly9zZWxsZXJjZW50cmFsLmFtYXpvbi5jb20vbm90aWZpY2F0aW9ucy9wcmVmZXJlbmNlcy9vcHRvdXQ_b3B0b3V0SWQ9YWNiZDZjNzgtOWE4YS00NzM3LWE0Y2ItYjQwOGZmYmZmM2Rj" metric="optout" style="text-decoration: none; color: #ffffff;">here.</a><br/><br/>
Copyright 2020 Amazon, Inc, or its affiliates. All rights reserved.<br/>
Amazon.com, 410 Terry Avenue North, Seattle, WA 98109-5210<br/></p>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<!-- BLOCK Footer About Us -->
</td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" class="templateContainer" style="width:100%;max-width:600px;border-collapse:collapse;" >
<tr>
<td>

</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
<!-- // END TEMPLATE -->
</td>
</tr>
</table><!-- Footer -->
<img src="https://sellercentral.amazon.com/nms/img/0f79f1b8-df77-35f0-a34e-b162c10f4875?sk=z9oMkEy-GLi5a6LyM6eC0Pc60RaGbZ1II-ytwDcXmVfdv5_HX-WjM4iIjNB1zBwoiegHmLAP_rsa8_oENttEEw&amp;n=1" height="1" width="1" border="0" alt=""></body>
</html>
ну конечно все зависит от того что надо выдернуть. если просто нужно письмо, то дернут все что между тегами <html> , как визуализировать html в текст не подскажу (как вариант через отдельную вкладку и вставку туда всех данных)
ну а если надо спарсить определенные данные, то да, надо делать парсинг под каждую структуру , ну или посмотреть какое нибудь общее явление.
 

Phoenix78

Client
Read only
Регистрация
06.11.2018
Сообщения
11 790
Благодарностей
5 694
Баллы
113

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
вот вспомнил. тут тема пролетала https://zennolab.com/discussion/threads/reguljarka-ochistit-h-tegi-ot-lishnix-tegov.78866/
может и вам подойдет вариант как там чистят от тегов.
Спасибо, от тегов очистил c помощью регулярного выражения:
Код:
<.*?>

C крякозябры

Код:
Return-Path: <[email protected]>

Delivered-To: [email protected]

Received: from DIR-01 ([10.10.147.191]) by IMAP-20 with LMTP id +Nr4M3Nzvl6xTgAALEJ/og (envelope-from <[email protected]>) for <[email protected]>; Fri, 15 May 2020 06:48:19 -0400

Received: from MTA-03.privateemail.com ([10.10.147.13]) by DIR-01 with LMTP id UAW4M3Nzvl5xRwAA6Rt3mQ (envelope-from <[email protected]>) for <[email protected]>; Fri, 15 May 2020 06:48:19 -0400

Received: from oxse2.privateemail.com (unknown [10.20.151.249]) by MTA-03.privateemail.com (Postfix) with ESMTP id D006A6004F for <[email protected]>; Fri, 15 May 2020 10:48:19 +0000 (UTC)

Received: from mail-lf1-f53.google.com ([209.85.167.53]) by oxse2.privateemail.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from <[email protected]>) id 1jZXt3-0000KS-TI for [email protected]; Fri, 15 May 2020 03:48:19 -0700

Received: by mail-lf1-f53.google.com with SMTP id 82so1439273lfh.2 for <[email protected]>; Fri, 15 May 2020 03:48:17 -0700 (PDT)

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rkzeSm6U23jv8jQpPI1TbiBgPEAmcGiai13q/8Jtr8A=; b=QcfuwZTdSySbnS5tRgY9cJBgC6jGIIu3fFmrYVGlL28UT24dRBfx9ZR1iKjpPFzxhQ MLO/Qq326L2K9mo38nxEnH+IF1a4O8aXrBqzUd8xONU4DWSyjwEhG3cSbY1aMddg6btG IIgUX6jXwABQZBQgc+5tuuhGYw/sKKWUnr7tU40ghuFusf0UWvEzGZZOn7efl5WvyVKX ZoQ1kKwhlgIyajn07n9ek3+22BF2CXkunqeIALntscjyvyMxmwGBFDO6OesEyr+1TpC+ tMhS+GwciUV60v5hO3tnCBNESvy/b1mTyNkSI8dcWQ8O/a1/hipKqxkBNZ/5U7L6zLXK bPRQ==

X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;        bh=rkzeSm6U23jv8jQpPI1TbiBgPEAmcGiai13q/8Jtr8A=;        b=RCpGKOZvqUdSBF6uqfMLVOxa+GNkV17ysmvUKvq1jz1WxnSXA0rlElI29gnwO30xxo         SDzC8mjyAYw+6LU24nrAWgUGHzCohVCTSNS5azt4MonpTWshK9D126XlmBvevX2/Q3mw         +VLfotB8R9ICQ4scl4PlvVraJ60hguY1uuLo6zOmTe/43WI5h4RWQ04pl0rnVtuT9F2e         jlW4r1/F8FweOGoKHNnefvvmB7lq6N4aVklJnK/yIN7BSiucfRWlyviBO5vjIwS1BJBZ         8TCvg80Hf3XGITY1lfGzQRhj6zNcOOvz2yKzZjjO92yEphcjAmUskrtE0WO5AEL5/mx0         GX2g==

X-Gm-Message-State: AOAM532TET2Zizt6/imuZlPBcNeF9Ja2Ttem3qbLvks2PdnDa35+7qey    b5h1Jwz+xpQgBOO3MEXyaG1hLAOBOjbvXln+qw36pCUgl+M=

X-Google-Smtp-Source: ABdhPJxsKT298Wky8uzAJn+ZWAOG2PC+mjbZL13EOviNGAPX53Qju4oPiqon4ghqJE7gR2sOO1jq2RxeJhQWfMrFwQA=

X-Received: by 2002:a19:505b:: with SMTP id z27mr1864281lfj.123.1589539695560; Fri, 15 May 2020 03:48:15 -0700 (PDT)

MIME-Version: 1.0

From: name <[email protected]>

Date: Fri, 15 May 2020 13:48:01 +0300

Message-ID: <CAOT03MaEhX6tYTvi9bVwxLa1r+sV-g6KtnVAB7J25Sisuj=88w@mail.gmail.com>

Subject: 123

To: [email protected]

Content-Type: multipart/alternative; boundary=000000000000e90aec05a5ad8cb9

Received-SPF: pass (oxse2.privateemail.com: domain of gmail.com designates 209.85.167.53 as permitted sender) client-ip=209.85.167.53; [email protected]; helo=mail-lf1-f53.google.com;

X-SPF-Result: oxse2.privateemail.com: domain of gmail.com designates 209.85.167.53 as permitted sender

Authentication-Results: oxse2.privateemail.com;    iprev=pass (mail-lf1-f53.google.com) smtp.remote-ip=209.85.167.53;    spf=pass smtp.mailfrom=gmail.com;    dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256;    dmarc=pass header.from=gmail.com

Authentication-Results: privateemail.com; spf=pass [email protected]; dkim=pass header.i=gmail.com

X-SpamExperts-Class: unsure

X-SpamExperts-Evidence: Combined (0.42)

X-Recommended-Action: accept

X-Filter-ID: 8G1aH+8yearZuN6N5+X5bm6KuAmzEgFjeXz34jnHp0zqASBuCXbDRuskypjv43MWAxBF+hqSZ1fX y4fGY+6Hx1EQyVzDVZOlehQ3EiJLhbvRL/Q2IQSYQXrchFIwwHewQ1u121o8Wqe2v3k8MvzRM/WK 0VeFr8xbdtN+8ilbC8aE3NBf0eqQ7iOAjxWPOiOgHCGTfDQ0227sJpkiaqoKb7UGXPMXi9JFr3WO x34n9ZeNnEmGXA+jBc+cg9XRwX9kxeO21g0tdUedE0fvdyY4xQQ6j+PhTNcj09FPctSGJKu92Wqt mAyBT4CGIb67Uu1JGL8XoF1JWUU8GgAQdtQK2PVLiitsLbvAhupvUnzDINDjcMbskMcaRQWUu9pQ An0SxmD/2Y9vQ6c+CWRhbvYX85cW4qP68vIV7wja8iRTqIQ1dHhpUbi1UdTVmV3LL7N95H6byOJ8 vf9ikZTmA4n6hL3pfiD/jA+oQ+PFuZrIzTtqy4TFaO7Oawv4tcQOp8LxvCrJPmnnTHzVkpybMK7Z TaBr8pt/DaNuU3OpatMcnajMNqQgWCylyaS0if2g9fi0FH069urP+T0mXHxFNmQkKyk4xAm9D8KT eKJT7gNACPc0qMr1QK6EAPEsIkYxeExJLzf55RJ623L3SQ+X7EqwDj0E9oteFb5G7+FeQsfyZgdq iVuDlheKyw4CH+ZNxx8EN5Aj5ip5uBeNExgwFSw+xqzJ8kyNJc44Wh+ScpJlSw3rPDC3Slc7LbIh tCq6gcXTu1p/rwLOlXBPDDedljrtasMZG8kjMz5Ex8yug66UtacIRl4ymL1PreZPaVSvsoddB9uP Xnqb9DvSf0x5SOjkbHF+lgOMZNnTHdpwyyEiiJHxRKoHS20LLK6joVra31KgiMoWiOu9SOMouzLB CSTh6kQ/A/Cc8aiHWlSZkH/fltu9tQG8rwtCxUT0KclziBNTXjsryEDgjhj13JNeUJEZn56wocO5 ELvaY6XDW1SOhvb/c+ok2qH9mFMYmAD2xU7xUfpelpiXZ0Shw66aSZn1sUFQ4FPMf16J1ee+Ao2D 6rF5yhTi9qm8IZJSHpFdJ5bb

X-Report-Abuse-To: [email protected]

ckx-imap-internaldate: 15-May-2020 06:48:20 -0400

ckx-imap-uid: 110

ckx-imap-isUid: NO

ckx-imap-seen: YES

ckx-imap-answered: NO

ckx-imap-deleted: NO

ckx-imap-flagged: NO

ckx-imap-draft: NO

ckx-imap-flags: \Seen \Recent
разобрался вот таким образом, может кому пригодится, по этапно:

1) От пустых строк можно избавиться с помощью замены на пустое значение через поиск по регулярному выражению
Код:
\n\r
2) А далее поиск по регулярному выражению. Поскольку в тексте находится после слова "Recent" и начинается с новой строки, конструкция будет следующая:
Код:
(?<=Recent)[\w\W]*
 
Последнее редактирование:

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
В общем, с этой задачей справился следующим образом:
1) Вытаскиваю все письма за необходимый мне интервал в таблицу, где выводится тема письма и само сообщение (включая информацию от почтового сервера и всякого рода кракозябры)
2) Беру из ячейки 0 столбца "название темы" текст, кладу результат в переменную "тема" и пересылаю её значение в телеграм канал
3) Беру из ячейки 0 столбца "сообщение" текст и перед отправкой в телеграм канал обрабатываю следующим образом:
а) беру данные с этой ячейки
55846

и кладу результат в переменную "сообщение"
б) удаляю лишние пустые строки
Код:
\n\r
и кладу результат в переменную "сообщение"
в) в результате этой переменной ищу через регулярное выражение и заменяю на пустоту всё то, что стандартно прописывает почтовый сервер, заканчивается словами "Recent" или "Seen", в моём случае. Добавляю [\w\W] который отвечает за перенос строк, чтобы захватывать абсолютно все строки, которые идут начиная с этих символов
Код:
(?<=Recent)|(?<=Seen)[\w\W]*
кладу результат в переменную "сообщение"
г) в результате этой переменной ищу через регулярное выражение и заменяю на пустоту всё то, что вписано в конец письма (что почта автоответчика и там какие-то информационные ссылки в моё случае, которые начинаются с -----. Добавляю [\w\W] который отвечает за перенос строк, чтобы захватывать абсолютно все строки, которые идут начиная с этих символов
Код:
--------------------------------------------------------------------------[\w\W]*
кладу результат в переменную "сообщение"
4) отправляю данные из переменной "тема" и "сообщение"

Реализовано на кубиках.

Как задать условие, чтобы выполнялось до тех пор, пока не пройдёт все строки?
Напишите, пожалуйста, решение на C# или объясните на кубиках как корректно задать условие, я пока что сделал лишь часть со счётчиком номера строки, не совсем понимаю как корректно сравнить его с последней строкой с текстом в таблице.

Спасибо!
 

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
Разобрался, достаточно было просто проверить, у меня уже было реализовано по-умолчанию, так как при получении пустого значения с таблицы просто прерывались дальнейшие действия, что и требовалось, в принципе, ведь если нет новых данных для обработки - значит можно прекратить их обработку)

Алгоритм:
1) Вводим переменную {-Variable.Counter-} как счётчик строки таблицы
2) Задаём ему значение 0 (первая строка)
3) Считываем необходимый по счёту столбец и ячейку со значением {-Variable.Counter-} с таблицы со всеми сообщениям
4) Увеличиваем значение на 1 каждый раз после выполнения цикла необходимых действий, кладём все результаты в таблицу, и возвращаемся на функцию чтения ячейки таблицы, где будет считывать уже следующая ячейка
Проверяем через уведомление: Когда строки в таблице заканчиваются, выводим уведомление в ZennoPoster, что работа завершена
55866
 

Вложения

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
Возникла маленькая проблема, помогите, пожалуйста.

Случается такое, что иногда содержимое письма видно ТОЛЬКО в HTML виде = tmp.Add(tuple.Item3);
а иногда ТОЛЬКО в текстовом виде = tmp.Add(tuple.Item4);
Тогда и обработка разная для этих случаев.
Как сделать условие, чтобы в итоге получить текст письма?
У меня мысль сделать проверку итогового значения переменной (после всех первичных операций, например с текстовым видом письма), и если оно пустое - применить другой метод обработки, условие для этого
Код:
'{-Variable.task_code-}'!=''
{/CODE]
Проблема только в символах пробела, которые есть в переменной, то есть по факту она не пустая и условие не выполняет :(
Я запутался как это реализовать. Помогите, пожалуйста! :(
 
Последнее редактирование:

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
И ещё момент, у меня не получается удалить лишние пробелы между строками
Код:
    We were unable to deliver the message you sent to Stephen Chase Smith for order 113-4746917-2102618 because the buyer has chosen to opt out of receiving unsolicited messages from sellers.





                   
                       
                           
                               
                                   
                                       
                                           
                                           
                                           
         
         
         
                                           
                                           
                                           
                                     
                                 
                           
                           
                       
                   
                   












   
       
           
           
               
               
                   
                   



   


    Dear Seller,
   
       
   
   
       
    We were unable to deliver the message you sent to Stephen Chase Smith on 2020-05-14 for order [113-4746917-2102618] because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
   
       
    However, even if a buyer has opted out of unsolicited messages, if you need to send them a message critical to completing his or her order, you can include the word [Important] in the subject of your e-mail to the buyer  or use the Buyer-Seller Messaging interface on Seller Central:
   
        Go to&nbsp;Manage Orders.
        Click the buyer’s name in the list, which will take you to&nbsp;Buyer-Seller Messaging.
        Select "Additional Information Required" as your subject, write your message, and click&nbsp;Send
   
   
    If you tried to respond to a buyer and received a message that the buyer has opted out of unsolicited seller messages, please respond to the buyer on the original message thread (instead of starting a new thread) and make sure that his or her original message is included in your reply.
   
    For your reference, the following messages are considered “critical” to complete the order:
   
        Product customization questions
        Delivery scheduling
        Issues with a shipping address
   
    The following messages are “not critical” to complete the order:
   
        Requests for seller feedback or customer reviews
        Order, shipment, or delivery confirmations
        Proactive customer service (for example: product manuals, tips for using the product, FAQs, suggestions if something goes wrong)
        Out-of-stock or delay notifications and offers of alternate products (please cancel the order instead)
   
   
    Learn more about&nbsp;Buyer-Seller Messaging&nbsp;and what messages are considered critical to completing orders.
   
    Sincerely,Amazon Seller Support





                   
                   
               
               
           
           
       
   





   





                       
                           
                               
                               
                                   
                                        &nbsp;
                                           
                                       
                                   
                               
                               
                           
                       
                   

                   
                   
                   
               
                   
                   
                   
                       
                           
                               
                                   
                                       
                                           
                                           
                                           
                       
                        Was this email helpful?

                        If you have any questions visit: Seller Central
                        To change your email preferences visit: Notification Preferences
                                                We hope you found this message to be useful. However, if you'd rather not receive future e-mails of this sort from Amazon.com, please opt-out here.
                                                Copyright 2020 Amazon, Inc, or its affiliates. All rights reserved.
                        Amazon.com, 410 Terry Avenue North, Seattle, WA 98109-5210
Нужно превратить в:
Код:
    We were unable to deliver the message you sent to Stephen Chase Smith for order 113-4746917-2102618 because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
    Dear Seller,
    We were unable to deliver the message you sent to Stephen Chase Smith on 2020-05-14 for order [113-4746917-2102618] because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
    However, even if a buyer has opted out of unsolicited messages, if you need to send them a message critical to completing his or her order, you can include the word [Important] in the subject of your e-mail to the buyer  or use the Buyer-Seller Messaging interface on Seller Central:
        Go to&nbsp;Manage Orders.
        Click the buyer’s name in the list, which will take you to&nbsp;Buyer-Seller Messaging.
        Select "Additional Information Required" as your subject, write your message, and click&nbsp;Send
    If you tried to respond to a buyer and received a message that the buyer has opted out of unsolicited seller messages, please respond to the buyer on the original message thread (instead of starting a new thread) and make sure that his or her original message is included in your reply.
    For your reference, the following messages are considered “critical” to complete the order:
        Product customization questions
        Delivery scheduling
        Issues with a shipping address
    The following messages are “not critical” to complete the order:
        Requests for seller feedback or customer reviews
        Order, shipment, or delivery confirmations
        Proactive customer service (for example: product manuals, tips for using the product, FAQs, suggestions if something goes wrong)
        Out-of-stock or delay notifications and offers of alternate products (please cancel the order instead)
    Learn more about&nbsp;Buyer-Seller Messaging&nbsp;and what messages are considered critical to completing orders.
    Sincerely,Amazon Seller Support
                        Was this email helpful?
                        If you have any questions visit: Seller Central
                        To change your email preferences visit: Notification Preferences
                                                We hope you found this message to be useful. However, if you'd rather not receive future e-mails of this sort from Amazon.com, please opt-out here.
                                                Copyright 2020 Amazon, Inc, or its affiliates. All rights reserved.
                        Amazon.com, 410 Terry Avenue North, Seattle, WA 98109-5210
То есть убрать пустые строки
 
Последнее редактирование:

AMZWIN

Client
Регистрация
13.05.2020
Сообщения
21
Благодарностей
0
Баллы
1
Решение:
Код:
(?m)^\ +|\ +(?=\r*$)
Удаляет пробелы в начале, в конце и между строк, все строки не обрабатываются.

Результат:
Код:
We were unable to deliver the message you sent to Pablo Velasquez for order 114-0060447-6597025 because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
Dear Seller,
We were unable to deliver the message you sent to Pablo Velasquez on 2020-05-16 for order [114-0060447-6597025] because the buyer has chosen to opt out of receiving unsolicited messages from sellers.
However, even if a buyer has opted out of unsolicited messages, if you need to send them a message critical to completing his or her order, you can include the word [Important] in the subject of your e-mail to the buyer  or use the Buyer-Seller Messaging interface on Seller Central:
Go to&nbsp;Manage Orders.
Click the buyer’s name in the list, which will take you to&nbsp;Buyer-Seller Messaging.
Select "Additional Information Required" as your subject, write your message, and click&nbsp;Send
If you tried to respond to a buyer and received a message that the buyer has opted out of unsolicited seller messages, please respond to the buyer on the original message thread (instead of starting a new thread) and make sure that his or her original message is included in your reply.
For your reference, the following messages are considered “critical” to complete the order:
Product customization questions
Delivery scheduling
Issues with a shipping address
The following messages are “not critical” to complete the order:
Requests for seller feedback or customer reviews
Order, shipment, or delivery confirmations
Proactive customer service (for example: product manuals, tips for using the product, FAQs, suggestions if something goes wrong)
Out-of-stock or delay notifications and offers of alternate products (please cancel the order instead)
Learn more about&nbsp;Buyer-Seller Messaging&nbsp;and what messages are considered critical to completing orders.
Sincerely,Amazon Seller Support
&nbsp;
Was this email helpful?
If you have any questions visit: Seller Central
To change your email preferences visit: Notification Preferences
We hope you found this message to be useful. However, if you'd rather not receive future e-mails of this sort from Amazon.com, please opt-out here.
Copyright 2020 Amazon, Inc, or its affiliates. All rights reserved.
Amazon.com, 410 Terry Avenue North, Seattle, WA 98109-5210
 
Последнее редактирование:

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)