CodeIgniter Forums
Want to use PHPMailer in a Controller in a CI project I will be making? - 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: Want to use PHPMailer in a Controller in a CI project I will be making? (/thread-30059.html)



Want to use PHPMailer in a Controller in a CI project I will be making? - El Forum - 05-01-2010

[eluser]bastones[/eluser]
Hi,

I want to use the PHPMailer library (phpmailer.worxware.com) that's quite popular AFAIK, so I'm wondering how would I properly integrate this into my CI-based script so I can use it in the relevant controllers because the PHPMailer library is obviously OOP-based.

Thanks,
Ben.


Want to use PHPMailer in a Controller in a CI project I will be making? - El Forum - 05-01-2010

[eluser]mi6crazyheart[/eluser]
why don't you use CI's own Email Class. It's really working cool. Recently i've used it one of my own project & it's working without any pain.....


Want to use PHPMailer in a Controller in a CI project I will be making? - El Forum - 05-01-2010

[eluser]bastones[/eluser]
I may end up using CI's built-in Email Class but just wondering for future reference how I would implement separate non-CI OOP-based libraries like PHPMailer into CI?


Want to use PHPMailer in a Controller in a CI project I will be making? - El Forum - 05-01-2010

[eluser]pickupman[/eluser]
[quote author="bastones" date="1272754995"]I may end up using CI's built-in Email Class but just wondering for future reference how I would implement separate non-CI OOP-based libraries like PHPMailer into CI?[/quote]
Like you would in PHP. You can include the file, create a new object, and pass methods on the object. If you are wanting to use another PHP class like how they are used in CI, then checkout the user guide for creating your own libraries. The simple explanation is rename class to start with a capital letter and the rest lower case. Place the file in your /application/libraries folder. Then use:
Code:
$this->load->library('phpmailer');
$this->phpmailer->some_method();



Want to use PHPMailer in a Controller in a CI project I will be making? - El Forum - 05-02-2010

[eluser]InsiteFX[/eluser]
If you search the forum and wiki you will find that someone
has already created a CI Library for it.

SEARCH - Is your friend...

InsiteFX