I'm using Twilio-python client. The vCard is rendered properly on android. However, on iPhone, it looks like a file and the extension (.vcard/.vcf) is visible. It still works but looks weird:
Twilio-to-iPhone (.vcard looks the same except for extension)
I tried sending a contact from android to iPhone and it was rendered properly by the iPhone:
Android-to-iPhone
Relevant posts that I have tried:
vCard sent with Twilio not properly rendered in iOS
Twilio - Sending vCard Not Rendering Properly
Generate VCard and Send Via Twilio
iOS failing to render vcf file
Vcard MMS file name is always "text 1"
Based on these posts, I tried several combinations of Content-Disposition, Content-Type, and Cache-Control headers in the media_url response but it still looks the same:
For Content-Disposition:
inline; filename="James.vcf"
attachment; filename="James.vcf"
inline; name="James"
attachment; name="James"
For Content-Type:
text/vcard
text/x-vcard
text/vcard
text/vcard; charset=utf-8; name="fileName.vcf"
Twilio blog for sending vcards via sms:
https://www.twilio.com/blog/send-vcard-twilio-sms
Related
We are using Redemption (v5.26) to convert messages from .msg format to .eml format in an Outlook COM addin.
I have created an email with the following subject: ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP and copied the subject to the message body. I've sent the message and after I received the message I made my test to check one of out customers report.
Our code does the following:
saves the current email to a .msg file using the following method _mailItem is the Outlook native MailItem:
_mailItem.SaveAs(filename, OlSaveAsType.olMSG);
converts the .msg file to .eml using Redemption (the objects are released of course)
rdoSession = RedemptionLoader.new_RDOSession();
rdoMail = rdoSession.GetMessageFromMsgFile(input);
rdoMail.SaveAs(output, rdoSaveAsType.olRFC822_Redemption);
Then checked the generated file and this is what it represented:
the subject encoded like below:
Subject: =?iso-8859-2?B?wVJWzVpUVVJPIFTcS9ZSRtpS00fJUA==?=
which is ÁRVÍZTURO TÜKÖRFÚRÓGÉP encoded.
The message body is encoded like below:
--7A24CA1FB85D3A4CB677EFC32587A338-474D54B8_message_boundary
Content-type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: Base64
Content-Disposition: inline
Content-Description: Message text
wVJWzVpU21LVIFTcS9ZSRtpS00fJUA0K
--7A24CA1FB85D3A4CB677EFC32587A338-474D54B8_message_boundary
which is encoded correctly.
Our customer reported it the same behavior but in the To and From headers.
Can I do anything to fix these fields encoding or is this a bug?
I try to import MIME emails. I get them by saving the incoming stream from an email server to a file.
It works very well except when there are attachments with very long filenames.
The content of the file is handled perfectly fine but the name and filename are shown in Outlook 365 as "Untitled attachment".
I use RDOMail.Import(string Path, [object Type]) from Redemption v5.21.0.05378.
Can you please give me a hint how to keep the original filename?
This is a part of an email I try to import:
[...]
Content-Type: text/plain; charset=UTF-8;
name*0="this is an attachment with a really long file name - i
hope "; name*1="it works like intended.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename*0="this is an attachment with a really long file name - i
hope "; filename*1="it works as intended.txt"
This is the file content ...
[...]
I was able to get the mail object with attachment using following API Call
https://graph.microsoft.com/v1.0/me/messages/${messageId}?$expand=attachments
I need to save raw MIME for the mail (i.e. .eml) which will be uploaded to our internal CRM.
I understand that one can make a simple .eml file in below fashion but I want to know if there is a simpler alternative to get this from the API directly.
To: Demo-Recipient <demo#demo.example.com>
Subject: EML with attachments
X-Unsent: 0
Content-Type: multipart/mixed; boundary=--boundary_text_string
----boundary_text_string
Content-Type: text/html; charset=UTF-8
<html>
<body>
<p>Example</p>
</body>
</html>
----boundary_text_string
Content-Type: application/octet-stream; name=demo.txt
Content-Transfer-Encoding: base64
Content-Disposition: attachment
ZXhhbXBsZQ==
----boundary_text_string
Content-Type: application/octet-stream; name=demo.log
Content-Transfer-Encoding: base64
Content-Disposition: attachment
ZXhhbXBsZQ==
----boundary_text_string--
There are two ways one can get a message in raw format (MIME), and both are now available in v1.0 of the Microsoft Graph API:
Append a $value to a get message operation.
If a message is attached as a file or item to another Outlook item (message or event) or group post, you can get that message attachment by appending $value to the get attachment operation.
Get MIME content of a message describes the two scenarios.
In general, keeping an eye on the Microsoft Graph blog site, the what's new topic, or the changelog topic (if it's API or permissions updates) would help you discover additions and updates you were looking for. In particular, the ability to get the MIME format of a message or message type attachment was introduced in April 2019 in the beta version, and promoted to v1.0 in September a few months later.
I am using the Mail gem to send out emails with attachments from my application. Specifically, I have identical code living on my devbox and a server machine which is used to report a pdf file. However, pdfs sent as attachments from my devbox show up in Thunderbird and other clients fine, whereas attachments from the server show up only in SOME (not thunderbird) mail clients fine. I've opened the email source to compare the two and try to get some insight into the issue:
Devbox:
--_av-F3fhmdkLZDU59RCz4nm2gw--
--_av-ycGAp26idM_6kl-0lMcYmw
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="report.pdf"
JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9MZW5ndGggNjc4L0ZpbHRlci9G
bGF0ZURlY29kZT4+c3RyZWFtCnic7Zhdb9owFIZ7S37FuZm0SZA53wkSF1Bg
...
MzBhN2RlZDE0ZmJkZDMwNzU1MzU2Y2ZhPjxlYTM0OTMzOTEwN2RmYzI1NTJh
NDE5NTJmNDhmN2MwMD5dL0luZm8gMzMgMCBSL1NpemUgMzQ+PgpzdGFydHhy
ZWYKNDE2NjQKJSVFT0YK
--_av-ycGAp26idM_6kl-0lMcYmw--
Server:
----==_mimepart_561d49a469c4d_33ee3fea57ad63b8624ae
Content-Type: application/pdf;
charset=UTF-8;
filename=report.pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=report.pdf
Content-ID: <561d49a46bc9f_33ee3fea57ad63b862596#autopilot-demo-east-web-1.mail>
JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9MZW5ndGggNjgwL0ZpbHRlci9G
bGF0ZURlY29kZT4+c3RyZWFtCnic7Zhdb9owFIZ7S37FuZm0SSVznJAPJC4o
oWs7qrVdql500xTAgNt8QGKg3a+fnQ5RbR3ttnYziQkR9jk+Pu95bEcKM+0V
nPjWcQ8WJMtpmjTBdI3RjQEnWcp9R/77tcfQbR19MW1u//Bxbe7RZH4Dpo51
..
N2I0MjdlNTE4ZTNmZGNmOGE5YzY1NTRjMzc+PGE1N2MzNmNkNTE0ZTQ1Mzlk
ZjY3OTU2ODZkY2M2ZDEzPl0vSW5mbyAzMyAwIFIvU2l6ZSAzND4+CnN0YXJ0
eHJlZgo0MTY2NgolJUVPRgo=
----==_mimepart_561d49a469c4d_33ee3fea57ad63b8624ae--
The simple line adding the attachment (Rails):
email.add_file filename: "sample.pdf", content: File.read("/public/sample.pdf")
Off the bat, the section identifiers are different (_av vs mimepart) and the way each attachment is encoded is also different after a few lines. My question is, what could be causing certain clients not to respect the "mimepart" sections as attachments? Beyond that, the next question would be why the same code would generate different output, but if I know the underlying issue I may be able to solve that myself. Thanks!
Hello this is my first post on this site.
Now i encountered a strange problem with MIME. I am working on writing emlx mail files.
(objective c, cocoa)
now i have no problem with showing images in mails. the problems is that half of my .doc and pdf attachments don't show in the message.
An formatting example.
MessageLength in Bytes(i.e 8556)
From: some#email
To: some#email2
Subject: mailsubject
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="somerandomgeneratedstring"
--somerandomgeneratedstring
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Body Text(not html body)
--somerandomgeneratedstring
Content-Type: application/msword; name="somefile.doc"
Content-Disposition: attachment; filename="somefile.doc"
Content-Transfer-Encoding: base64
[base64 encoded data]
--somerandomgeneratedstring--
PlistStructure
The text body is always displayed properly. The problem is that some text file attachments like .doc and pdf are not displayed, i run the same code for multiple text files and some work and some do not i have no clue why. all pictures work.
The thing i don't get is if i use the same data that wont work for MIME and write is as a file to my desktop the file is displayed properly.
Is there something i am missing ? Is there something i have to take care of when encoding such files in base64 ? if so why do some files work and others dont ?(source is in binary format, i encode is using nsdata base64encoding in Xcode)
I have gone trough the mime documentation multiple times and i cant seem so find a solution.
Can anyone please give me some tips or suggestions ?
EDIT: omg i forgot about this, The problem was that i had a problem with the first line, length in bytes, after i fixed that it worked. Sorry for wasting time :(
You need to get rid of the blank line between the top-level MIME-Version and Content-Type headers. MIME headers and body are separated by a blank line, so your Content-Type is effectively ignored as a header and treated as body content instead.
From: some#email
To: some#email2
Subject: mailsubject
MIME-Version: 1.0
<-- get rid of this blank line
Content-Type: multipart/mixed; boundary="somerandomgeneratedstring"
Update: since this problem is not a factor anymore, the only remaining factor you have not shown yet is the actual base64 data. It is likely malformed in some way that is preventing proper decoding. Everything else you have shown is accurate.