Added Email::attach_cid() returning CID which enables to embed an attachment to html #1585

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
2 participants

melounek commented Jul 6, 2012

Sorry there are few more changes in this one pull request, but every this changes are connected and can't be separate. Look at commits as in individual changes. Every these changes are directed for attaching inline images, but if some commit is insufficient or something, I can rewrite it.

If you want to try demo of this functins, I'm sending email to you with demo in few minutes.

@narfbg narfbg commented on the diff Jan 9, 2014

system/libraries/Email.php
+ }
+
+ if ( ! $fp = fopen($filename, FOPEN_READ))
+ {
+ $this->_set_error_message('lang:email_attachment_unreadable', $filename);
+ unset($this->_attachments[$ind]);
+ return FALSE;
+ }
+
+ $this->_attachments[$ind]['type'] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION));
+ $file_content = stream_get_contents($fp);
+ fclose($fp);
+ }
+ else
+ {
+ $file_content = $filename;
@narfbg

narfbg Jan 9, 2014

Contributor

What is this for?

@melounek

melounek Jan 9, 2014

Looks like opportunity to attach plain text instead of filename, but you are right, this shouldn't be in this pull-request.
Should I do this pull-request again for actual version and without this mistake?

@narfbg

narfbg Jan 9, 2014

Contributor

Yes, please.
Quite a lot of changes have been done to the Email library since this was submitted anyway. The $_attachments unification for example is already done.

@melounek

melounek Jan 10, 2014

Now I see it... the opportunity to attach buffer instead of filename is already there https://github.com/melounek/CodeIgniter/blob/develop/system/libraries/Email.php#L1367
documented there https://github.com/melounek/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst (find "email library")

anyway... today I will send actual pull request...

Contributor

narfbg commented Jan 10, 2014

Replaced by #2807.

narfbg closed this Jan 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment