0

Please excuse the fact I'm probably asking a simple question however I cannot seam to find a solution to my problem.

I am trying to send an email via a POST to a 3rd party, the 3rd party will let me send SUBJECT, RECIPETANTS and HTML BODY. what I would like to do is add to send attachments, from my research it is possible to do this with BASE64 and using a MULTIPART MIME however I really cant find any up to date and clear info.

I guess what I am asking for is some expert opinion on the best way to accomplish an email with non-inline attachments within my given limitations

this is what I have tried

Content-Type: multipart/mixed; boundary=047d7b41cc5c82ae5d051712c40c

--047d7b41cc5c82ae5d051712c40c Content-Type: text/plain; charset=UTF-8

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque odio urna, bibendum eu ultricies in, dignissim in magna. Vivamus risus justo, viverra sed dapibus eu, laoreet eget erat. Sed pretium a urna id pulvinar. Best regards

--047d7b41cc5c82ae5d051712c40c

Content-Type: image/.pdf; name="Job Quote for $2,122.26 by SalesTechPro " Content-Disposition: attachment; filename="Job Quote for $2,122.26 by SalesTechPro ..pdf" Content-Transfer-Encoding: base64 X-Attachment-Id: a1e95393-bf80-4844-991a-f41ef177662b

JVBERi0xLjUKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL01lZGlhQm94IFswIDAgNTk1LjAwIDg0Mi4wMF0KL1Jlc291cmNlcyAyIDAgUgovQ29udGVudHMgNCAwIFI+Pgplbm(lots of letters) MDAxMDg2NCAwMDAwMCBuIAowMDAwMDExNDA5IDAwMDAwIG4gCjAwMDAwMTE0MjkgMDAwMDAgbiAKMDAwMDAxMTU1NSAwMDAwMCBuIAowMDAwMDExNjMxIDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgMjAKL1Jvb3QgMTkgMCBSCi9JbmZvIDE4IDAgUgo+PgpzdGFydHhyZWYKMTE3MzUKJSVFT0YK --047d7b41cc5c82ae5d051712c40c--

Chad Lewis
  • 13
  • 2
  • This [link](https://stackoverflow.com/help/mcve) might help. – Syfer May 22 '18 at 12:02
  • thanks Syfer, I'm not sure how your link helps. the code is there just to show what I have tried. I know near nothing about code or html and am just trying to learn. Also I am more asking if this type of method is even the method I should be trying. – Chad Lewis May 22 '18 at 12:22
  • In stack overflow you try first and when you get stuck you ask for help as per that link. Create a Minimal, Complete, and Verifiable example with the code you have tried. – Syfer May 22 '18 at 12:36
  • So I have tried with that code, however I feel that I may not be trying the right thing. From what I have read encoding images in base64 can possibly be unreliable. There would be no point spending my time perfecting the wrong thing. Hence I ask the question is the route I’m going down the best method of achieving what I would like. If you know the answer it would have taken less than a minute to indicate to me if it is or not or even point me in a different direction. I have posted the code I have tried but without all the base64 as I thought I would offend someone with it being too long – Chad Lewis May 22 '18 at 21:18
  • Original question is adding attachments to emails, now you want to add b64 images to emails. You haven't noted down the language you are using for this or the code that you have used to do the attachment. Search engine with right parameters would have given you an answer as vague as your question is. Re: B64 images, it has patchy support across email clients. Re: Attachments, everyone needs more info as to what you have done so they can help out. – Syfer May 22 '18 at 21:29
  • try that link: https://stackoverflow.com/questions/30351465/html-email-with-inline-attachments-and-non-inline-attachments – Syfer May 22 '18 at 21:30
  • I still feel like I can’t give you anymore, there is code I have tried displayed hence I have completed your requirement to try, the code contains a base64 element as this was to the best of what I could work out the only way I could attach an attachment from searching that I have undertaken on this website and the larger web in order to attach non inline in HTML. I apologise if my message was confusing I thought it was clear that my restrictions are that the 3rd party I am using can only accept a HTML message body and that under these restrictions I would like to try and send attachements. – Chad Lewis May 22 '18 at 21:36

0 Answers0