postal icon indicating copy to clipboard operation
postal copied to clipboard

Issue with attachment in Email API

Open rccess opened this issue 3 years ago • 1 comments

i am trying to send emails with attachment from email API

attachment picked successfully but file got courrepted

i have tested with word, pdf , txt file. all are receiving as a corrupted files,

here is the code i am using for txt

{ "to": ["[email protected]" ], "from":"company[email protected]", "sender": "company", "subject": "Email API Test", "plain_body": "hello this email api checking", "attachments": [{ "name": "docs.txt", "content_type": "text/plain", "data": "base64_encode($data)", "content_url": "https://www.xyz.com/wp-content/uploads/2023/03/docs.txt" }] }

for docx { "to": ["[email protected]" ], "from":"company[email protected]", "sender": "company", "subject": "Email API Test", "plain_body": "hello this email api checking", "attachments": [{ "name": "123.docx", "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "data": "base64_encode($data)", "content_url": "http://domain.com/images/article/123.docx" }] }

is there anything which i am missing ?

rccess avatar Mar 16 '23 09:03 rccess

duplicate of #2375

willpower232 avatar Mar 16 '23 15:03 willpower232