Microsoft Graph MIME content - microsoft-graph-api

I am trying to get MIME content from mail via Microsoft Graph.
It works fine for the emails received. But for sent mail, the MIME file is missing sentDateTime
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('9c934d23-5f49-4bdc-b1cc-8e5822d479bb')/messages/$entity",
"#odata.etag": "W/\"CQAAABYAAACBmUMmRgniS66W2x3+/Z4uAANecm6i\"",
"id": "AAMkADJjNThkZDIzLTM0M2MtNDBkNS1iNmNlLWEzMWEzYjMwY2M2NgBGAAAAAADQJQpK-gaHR5h_hbt1-C17BwCBmUMmRgniS66W2x3_-Z4uAAJUh6HiAACBmUMmRgniS66W2x3_-Z4uAANJ-s5hAAA=",
"createdDateTime": "2020-11-28T13:32:33Z",
"lastModifiedDateTime": "2020-11-28T13:33:17Z",
"changeKey": "CQAAABYAAACBmUMmRgniS66W2x3+/Z4uAANecm6i",
"categories": [
"NIRAS copy to: Passed"
],
"receivedDateTime": "2020-11-28T13:31:00Z",
"**sentDateTime**": "2020-11-28T13:31:45Z",
"hasAttachments": false,
MIME content: ...../messages/AAMkADJjNT...
From: "Reza Matin (REMA)" XXXX#niras.dk
To: Reza Matin yyyyy#gmail.com
Subject: MIME send mail test
Thread-Topic: MIME send mail test
Thread-Index: AdbFitC4fR/JJs5vSaCOp5gLqDx+jA==
Date: Sat,
28 Nov 2020 13: 31: 45 +0000
Message-ID:
AM9PR07MB71863080DD521AEA1FAF9C18A7F70#AM9PR07MB7186.eurprd07.prod.outlook.com
Keywords: NIRAS copy to: Passed
Content-Language: da-DK
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
Content-Type: multipart/alternative;
boundary="000_AM9PR07MB71863080DD521AEA1FAF9C18A7F70AM9PR07MB7186eurp"
MIME-Version: 1.0
--000_AM9PR07MB71863080DD521AEA1FAF9C18A7F70AM9PR07MB7186eurp
Content-Type: text/plain; charset="us-ascii"

Related

Gmail LodgingReservation Email Markup doesn't work

I try to use LodgingReservation Markup.
Documentation says that I can send email from own gmail mailbox to the same mailbox for testing.
I prepared simple test email:
<html>
<head>
</head>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "LodgingReservation",
"reservationNumber": "abc456",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "LodgingBusiness",
"name": "Hilton San Francisco Union Square",
"address": {
"#type": "PostalAddress",
"streetAddress": "333 O'Farrell St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"telephone": "415-771-1400"
},
"checkinDate": "2027-04-11T16:00:00-08:00",
"checkoutDate": "2027-04-13T11:00:00-08:00"
}
</script>
test
</body>
</html>
Email markup Tester can parse it successfully. But when I send the email and check it in my Inbox, it doesn't show card with reservation's information.
Origin message:
Return-Path: <kaba.nitesoft#gmail.com>
Received: from MSI ([90.189.151.28])
by smtp.gmail.com with ESMTPSA id q16-20020a2e84d0000000b0025e71cdb753sm287017ljh.46.2022.08.09.23.49.57
for <kaba.nitesoft#gmail.com>
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Tue, 09 Aug 2022 23:49:58 -0700 (PDT)
Message-ID: <62f35516.2e0a0220.3adbf.15f2#mx.google.com>
Date: Tue, 09 Aug 2022 23:49:58 -0700 (PDT)
X-Google-Original-Date: 10 Aug 2022 13:49:58 +0700
MIME-Version: 1.0
From: kaba.nitesoft#gmail.com
To: kaba.nitesoft#gmail.com
Subject: Confirmation
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
PGh0bWw+DQoJCQkJCQkJCTxoZWFkPiANCgkJCQkJCQkJPC9oZWFkPg0KCQkJCQkJCQk8
Ym9keT4NCgkJCQkJCQkJCQk8c2NyaXB0IHR5cGU9ImFwcGxpY2F0aW9uL2xkK2pzb24i
Pg0KCQkJCQkJCQkJCXsNCgkJCQkJCQkJCQkgICJAY29udGV4dCI6ICJodHRw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kJCQkJICB9LA0KCQkJCQkJCQkJCSAgImNoZWNraW5EYXRlIjog
IjIwMjctMDQtMTFUMTY6MDA6MDAtMDg6MDAiLA0KCQkJCQkJCQkJCSAgImNoZWNrb3V0
RGF0ZSI6ICIyMDI3LTA0LTEzVDExOjAwOjAwLTA4OjAwIg0KCQkJCQkJCQkJCX0NCgkJ
CQkJCQkJCQk8L3NjcmlwdD4NCgkJCQkJCQkJCXRlc3QNCgkJCQkJCQkJPC9ib2R5Pg0K
CQkJCQkJCTwvaHRtbD4=
What is wrong? How I can test markup correctly?
Another question:
If email contains attached receipt in pdf-format, Gmail shows reservation's card by parsed data from attached file. It's problem that Gmail parses it incorrectly (for instance it shows incorrect CheckoutDate). So, can I disable this behavior? Or how I can format pdf document that it will be parsed correctly?

Email schemas self test looks like a normal message

I'm tring my schema email.
The json-ld content is just copied from the google example.
I'm sending from my gmail address to my gmail address a custom HTML with json-ld script tag using SMTP connection.
The received email has a valid content, I have validated it using the schema validation tool (https://www.google.com/webmasters/markup-tester/u/0/), but the message in gmail is shown as a normal message without any special decoration.
What I'm missing?
This is the message:
Return-Path: <....#gmail.com>
Received: from .......
To: ....#gmail.com
From: .... <.....#gmail.com>
Subject: test
Message-ID: <.......#gmail.com>
Date: Wed, 14 Apr 2021 10:13:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------C711D6157D722F58A7A70245"
Content-Language: it
--------------C711D6157D722F58A7A70245
Content-Type: text/plain; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
test
--------------C711D6157D722F58A7A70245
Content-Type: text/html; charset=iso-8859-15
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body>
<p>test</p>
<p>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Person",
"name": "John Doe",
"jobTitle": "Graduate research assistant",
"affiliation": "University of Dreams",
"additionalName": "Johnny",
"url": "http://www.example.com",
"address": {
"#type": "PostalAddress",
"streetAddress": "1234 Peach Drive",
"addressLocality": "Wonderland",
"addressRegion": "Georgia"
}
}
</script></p>
</body>
</html>
--------------C711D6157D722F58A7A70245--

Test google schema in my gmail account

I'm a starter in Google Schema, I've followed the getting started, but it doesn't work... I've changed to another more simple json-ld, simple actions, but ....
I'm testing with a Django project, in my local, django smtp config to smpt.gmail.com. Same from and to email. I can see the email, but I can't see go-to-action....
This is my original mail:
Return-Path: <XX#gmail.com>
Received: from tomas-H55M-D2H (37.130.151.22.radiocable.net. [37.130.151.22])
by mx.google.com with ESMTPSA id n3sm2456222wix.1.2015.05.12.04.20.07
for <XX#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 12 May 2015 04:20:07 -0700 (PDT)
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
Subject: Testing
From: XX#gmail.com
To: XX#gmail.com
Date: Tue, 12 May 2015 11:20:07 -0000
Message-ID: <20150512112007.23123.78164#tomas-H55M-D2H>
Reply-To: XX#gmail.com
<html>
<head>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Check this out",
"action": {
"#type": "ViewAction",
"url": "https://www.youtube.com/watch?v=eH8KwfdkSqU"
}
}
</script>
</head>
<body>
<p>
This a test for a Go-To action in Gmail.
</p>
</body>
</html>

Outlook appointment with rails

I'm trying to send an appointment from ruby (rails) to Microsoft Outlook 2013.
When I'm sending an ICS file in the attachment, user have to open the file manually.
Looking for a way to send normal meeting request (user won’t need to open ICS to accept it).
I read the tutorial: http://knaveofdiamonds.com/post/50689213/sending-outlook-appointments-with-ruby
but it’s not working for me, user getting the following email:
--
Date: Tue, 27 May 2014 23:17:23 +0300
Message-ID: <5384f2d3b125b_90c30357c28514#Eric-PC.mail>
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: base64
Content-Disposition: inline
QSBSdWJ5IGNyZWF0ZWQgYXBwb2ludG1lbnQ=
--
Date: Tue, 27 May 2014 23:17:23 +0300
Message-ID: <5384f2d3b1e13_90c30357c2861e#Eric-PC.mail>
Mime-Version: 1.0
Content-Type: text/calendar;
charset=UTF-8;
method=request;
name=subject.ics
Content-Transfer-Encoding: quoted-printable
content-class: urn:content-classes:calendarmessage
BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20140527T201722Z
UID:abb15328-a6af-4c95-8e04-acdb9d6584e2
DTSTART:20140623T083000
DTEND:20140624T083000
CLASS:PRIVATE
DESCRIPTION:Have a long lunch meeting and decide nothing...
SUMMARY:Meeting with the man.
END:VEVENT
END:VCALENDAR
This is my ruby code
cal = Icalendar::Calendar.new
cal.event do |e|
e.dtstart = DateTime.civil(2014, 6, 23, 8, 30)
e.dtend = DateTime.civil(2014, 6, 24, 8, 30)
e.summary = "Meeting with the man."
e.description = "Have a long lunch meeting and decide nothing..."
e.ip_class = "PRIVATE"
e.uid = SecureRandom.uuid
end
Mail.defaults do
delivery_method :smtp, options
end
mail = Mail.new
mail.mime_version = "1.0"
mail.body = cal.to_ical
mail.from = 'ericfeldman93#gmail.com'
mail.to = 'ericfeldman93#gmail.com'
mail.subject = 'bla'
mail.content_type = "text/calendar"
mail.deliver
Any idea?
You should not send an ICS file as an attachment. Your whole message must have the content type of text/calendar and it should have a single part - text/calendar:
Date: Tue, 27 May 2014 23:17:23 +0300
Message-ID: <5384f2d3b125b_90c30357c28514#Eric-PC.mail>
Mime-Version: 1.0
Content-Type: text/calendar;
charset=UTF-8;
method=request;
name=subject.ics
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
content-class: urn:content-classes:calendarmessage
BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20140527T201722Z
UID:abb15328-a6af-4c95-8e04-acdb9d6584e2
DTSTART:20140623T083000
DTEND:20140624T083000
CLASS:PRIVATE
DESCRIPTION:Have a long lunch meeting and decide nothing...
SUMMARY:Meeting with the man.
END:VEVENT
END:VCALENDAR

Attachment not sent properly in rails using ActionMailer

I am trying to send xls file via ActionMailer.
mailer = ActionMailer::Base.mail(:to => "reciever#gmail.com", :from => "sender#gmail.com", :content_type=>"application/vnd.ms-excel", :body=> '')
mailer.attachments['filename.xls']= {mime_type: 'application/vnd.ms-excel', content: File.read("filePath.xls")}
mailer.deliver!
I am able to receive the mail as well.
But somehow the attachment is not correct, it shows up as noname and below is the content I get in the file (I am copy pasting the exact contents)
--
Date: Wed, 04 Jun 2014 23:33:48 +0530
Mime-Version: 1.0
Content-Type: application/vnd.ms-excel;
charset=UTF-8
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename=filename.xls
Content-ID: <538f5f82836992#C02L2178FFT3.gmail>
PGgzIHN0eWxlPSJmb250LXdlaWdodDpib2xkIj4gCiAgICBTaG93aW5nCiAg
ICBvcGVuCiAgICByZXF1ZXN0cwogICAgZnJvbQogICAgTm92IDIxLCAyMDEz
....
I am sure I am missing something simple, I am unable to figure out what. Can someone help?
Try this:--
mailer = ActionMailer::Base.mail(:to => "reciever#gmail.com", :from => "sender#gmail.com", :content_type=>"application/vnd.ms-excel", :body=> '')
mailer.attachments["filename.xls"]= File.read("filePath.xls")
mailer.deliver!

Resources