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

Adding CID tags for attachments #75

Merged
merged 2 commits into from Aug 28, 2021
Merged

Adding CID tags for attachments #75

merged 2 commits into from Aug 28, 2021

Conversation

danielhomola
Copy link
Contributor

Hi there,

This took me a while to figure out but basically with this tiny modification, any attachment (images primarily) can be used as inline images within the HTML email like:

<img src="cid:name_of_image_file.jpg">

This will only work if the image files are in the root directory (as I'm parsing out all parent folders from the path) but in that case it works like a charm, and even Gmail likes it and displays the image automatically within the body of the email at the designated location as opposed to just having the image be at bottom like some random attachment..

I thought this is quite a big improvement..

@dawidd6
Copy link
Owner

dawidd6 commented Aug 28, 2021

What is this replace function doing exactly?

@danielhomola
Copy link
Contributor Author

Sorry I should have left a comment. It's just fishing out the filename from the path so you can reference the img in a html email easily by its name and a prefixed cid tag. See https://stackoverflow.com/a/423385

@dawidd6 dawidd6 merged commit 4ef78fc into dawidd6:master Aug 28, 2021
@dawidd6
Copy link
Owner

dawidd6 commented Aug 28, 2021

Ok thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants