Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new email with .eml attachment #238

Open
jonibi opened this issue Oct 18, 2022 · 0 comments
Open

Creating a new email with .eml attachment #238

jonibi opened this issue Oct 18, 2022 · 0 comments

Comments

@jonibi
Copy link

jonibi commented Oct 18, 2022

Hello,

I want to attach an .eml file to a Exchange Draft. The issue is that it attaches the message, but the MIME attachment in email is with

Content-Type: application/octet-stream

and it doesn't have a preview available for Outlook desktop.

$api->getClient()->CreateAttachment(array (
    'ParentItemId' => $mailId->toArray(),
    'Attachments' => array (
        'FileAttachment' => array (
            'Name' => 'message.eml',
            'Content' => file_get_contents('message.eml'),
            'ContentType' => 'message/rfc822'
        )
    ),
));

If I try to change
ContentType' => 'message'
it places on the email Content-Type: message/rfc822, but it has empty Content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant