Welcome Guest, Not a member yet? Register   Sign In
Want to use PHPMailer in a Controller in a CI project I will be making?
#1

[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.
#2

[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.....
#3

[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?
#4

[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();
#5

[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




Theme © iAndrew 2016 - Forum software by © MyBB