You appear to be putting the whole message and attachment in the headers, and then the attachment again as the message body.
You've also said that the attachment is base-64 encoded, but you haven't encoded it.
I suggest you read the
PHP mail manual page[
^] and follow the links on that page to the RFCs that cover email and MIME.