CodeIgniter Forums
Can't send Email with an attachement - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Can't send Email with an attachement (/thread-27451.html)



Can't send Email with an attachement - El Forum - 02-11-2010

[eluser]Unknown[/eluser]
Hello everyone its been some time till i have been working in CI...

I came across a requirement to send a pdf as an attachment...

M using the following code:

$this->load->library('email');
$this->email->set_newline("\r\n");
$this->email->clear();
$this->email->from('[email protected]', 'Name');
$this->email->to('[email protected]');
$this->email->subject('subject');
$this->email->message('It is working. Great!!');

$this->email->attach('/path/to/file');

now the problem is that this is what i get in email:

Content-Type: multipart/mixed; boundary="B_ATC_4b748f94ea881"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ATC_4b748f94ea881
Content-Type: multipart/alternative; charset=utf-8
Content-Transfer-Encoding: 8bit

It is working. Great! Wooohooo!


--B_ATC_4b748f94ea881
- Hide quoted text -
Content-type: application/pdf; name="pdt_example_001.pdf"
Content-Disposition: attachment;
Content-Transfer-Encoding: base64

JVBERi0xLjcKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL01lZGlhQm94IFsw
IDAgNTk1LjI4IDg0MS44OV0KL1Jlc291cmNlcyAyIDAgUgovQ29udGVudHMgNCAwIFI+PgplbmRv
YmoKNCAwIG9iago8PC9GaWx0ZXIgL0ZsYXRlRGVjb2RlIC9MZW5ndGggMjcxPj4Kc3RyZWFtCnic
vZExTwMxDIX3/Io3wnCuk1wuyYpUKnVryVZ1QLpSqWol2qWM/FyQmNjY8OXawomjIAYGJ7LlfM95
ZnIeezDGEivM5nLVEiOJpbpKGFwb6IqYke4wTGrbFm2nmEsl9EeFz3JPjN8+2IKllTvnbgnBaGNI
B4SSKUakGrMLXM6RxgLFRLDBYa8EK7FSDbbRrNVX3nR06O4Mkbt71KftYCYQewTrKWps4CpPRh/z
NW6gJj98rcfj8w9E0joEbcmVcDaQCyhsSWywW4iiAI3JY/ioyXBryvDhdnO/XoBZo8Dj0/PL69vR
J6X61/o/5uWuk3U5a4z7fuWlj+QrFI6sPWxcYwDzae1/MF29AyLfpAEKZW5kc3RyZWFtCmVuZG9i
ago1IDAgb2JqCjw8L1R5cGUgL1BhZ2UKL1BhcmVudCAxIDAgUgovTWVkaWFCb3ggWzAgMCA1OTUu
MjggODQxLjg5XQovUmVzb3VyY2VzIDIgMCBSCi9Db250ZW50cyA2IDAgUj4+CmVuZG9iago2IDAg
b2JqCjw8L0ZpbHRlciAvRmxhdGVEZWNvZGUgL0xlbmd0aCAyODA+PgpzdHJlYW0KeJy9UsFOAjEQ
vfcr3lEOWzrtdtseRRAlQQO7ngi3DSREY/DC7ztbFrRxEfDgYdrMy/TNzHtV0jrsoDDh2GCx5Kvm
GHOsxaBC/16DCqkUqhVGldjuQZOAEcpBX4j6lffIcemDLRSXquT8WINpSGtJHj5XMgRUNRY36C1R
TZgUM6b1FjvBtBwb0dA2PWvxk28+bquTIWJ1R/f5fjDtpXLwxslAeIMtnNR0yF9RQszOrNah8dkH
hiQFeOWbZnHnu+fhCCYgw+1T+YjpA/Eu04yCN4y9lMOsuQ3eVwgHea5vfdoG1sHYZCLSTpsi9+2Z
eHKlHqL71/2Pt7Hq6GzMGl9PS5G7IF2BzEpj2g+p0Yf+psBfNPgEEYbBSQplbmRzdHJlYW0KZW5k
b2JqCjEgMCBvYmoKPDwvVHlwZSAvUGFnZXMKL0tpZHMgWwozIDAgUgo1IDAgUgpdCi9Db3VudCAy
Cj4+CmVuZG9iago3IDAgb2JqCjw8L1R5cGUgL09DRyAvTmFtZSAo/v8AcAByAGkAbgB0KQovVXNh
Z2UgPDwvUHJpbnQgPDwvUHJpbnRTdGF0ZSAvT04+PiAvVmlldyA8PC9WaW.......

And a lot like that...

Help me plz...

thanking you


Can't send Email with an attachement - El Forum - 08-02-2010

[eluser]Sheldon[/eluser]
I have having the same issue.

The PDF shows fine in my mail client, but a lot of my customers is doesnt work Sad