0

We're receiving automated emails, which have a CSV attached. Using PHP, I'm grabbing mail via IMAP. I can grab the eMails and attachments no problem. However, the CSV's are attached as octet-streams.

How can I convert that to something I can actually work with? Currently when reading the contents, I'm just getting stuff that looks like this:

NzA1MTA1NTgxMzAsODgxDQo3MDUxMDU1ODEyMCw1NzkNCjcwNTEwNTU4MTEwLDQ3MQ0KNzA1MTA1==

1
  • What you're looking at is base-64 encoding. Commented Jun 8, 2012 at 17:10

1 Answer 1

2

Use base64_decode().

http://php.net/manual/en/function.base64-decode.php

Better yet, look at the encoding headers in the e-mail so that you know whether or not something is actually encoded the way you expect.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.