summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/libraries/email.rst
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide_src/source/libraries/email.rst')
-rw-r--r--user_guide_src/source/libraries/email.rst28
1 files changed, 26 insertions, 2 deletions
diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst
index 39629ece1..86f440a74 100644
--- a/user_guide_src/source/libraries/email.rst
+++ b/user_guide_src/source/libraries/email.rst
@@ -247,8 +247,8 @@ $this->email->attach()
----------------------
Enables you to send an attachment. Put the file path/name in the first
-parameter. Note: Use a file path, not a URL. For multiple attachments
-use the method multiple times. For example::
+parameter. For multiple attachments use the method multiple times.
+For example::
$this->email->attach('/path/to/photo1.jpg');
$this->email->attach('/path/to/photo2.jpg');
@@ -259,6 +259,10 @@ otherwise use a custom disposition::
$this->email->attach('image.jpg', 'inline');
+You can use URL::
+
+ $this->email->attach('http://example.com/filename.pdf');
+
If you'd like to use a custom file name, you can use the third paramater::
$this->email->attach('filename.pdf', 'attachment', 'report.pdf');
@@ -269,6 +273,26 @@ parameter as mime-type::
$this->email->attach($buffer, 'attachment', 'report.pdf', 'application/pdf');
+$this->email->attachment_cid()
+------------------------------
+
+Sets and returns an attachment's Content-ID, which enables your to embed an inline
+(picture) attachment into HTML. First parameter must be attached file.
+
+::
+
+ $filename = '/img/photo1.jpg';
+ $this->email->attach($filename);
+ foreach ($list as $address)
+ {
+ $this->email->to($address);
+ $cid = $this->email->attach_cid($filename);
+ $this->email->message('<img src='cid:". $cid ."' alt="photo1" />');
+ $this->email->send();
+ }
+
+CID for each Email have to be create again to be unique.
+
$this->email->print_debugger()
------------------------------