Welcome Guest, Not a member yet? Register   Sign In
email class doesn't work
#1

[eluser]aryan_[/eluser]
I am using codeigniter email class to send email, but it doesn't work. page freezes. I'm using xampp.

Can I send email using gmail.

Please reply asap.

thanks
#2

[eluser]johnnyForums[/eluser]
[quote author="aryan_" date="1248399063"]I am using codeigniter email class to send email, but it doesn't work. page freezes. I'm using xampp.

Can I send email using gmail.

Please reply asap.

thanks[/quote]

Maybe you should post some code. Your message is kind of vague.
#3

[eluser]aryan_[/eluser]
$this->load->library('email');
$this->email->from('[email protected]localhost.com', 'aryan');
$this->email->to('[email protected]', 'test');
$this->email->subject('Email subject');
$this->email->message('Testing the email class.');
$this->email->send();

I followed this tutorial

http://www.tildemark.com/programming/php...xampp.html
#4

[eluser]InsiteFX[/eluser]
Hi aryan_,

I use this for testing my emails on xampp.

http://www.toolheap.com/test-mail-server-tool/
#5

[eluser]eoinmcg[/eluser]
[quote author="aryan_" date="1248399063"]

Can I send email using gmail.

[/quote]

Yup. http://ellislab.com/forums/viewthread/84689/
#6

[eluser]InsiteFX[/eluser]
Hi eoinmcg,

PHP will send email from your own sever, so if you have your own online website you should have a mail server

Enjoy
InsiteFX
#7

[eluser]eoinmcg[/eluser]
Hi InsiteFX,

Haven't used XAMP myself hence answering only the part about whether CI can send via gmail.

Quote:PHP will send email from your own sever, so if you have your own online website you should have a mail server

Personally I don't like doing it this way; seems to get caught by spam filters way too much and when setting up production servers I tend to install only the bare minimum.

Each to his (or her) own, though ;-P
#8

[eluser]aryan_[/eluser]
[quote author="InsiteFX" date="1248478214"]Hi eoinmcg,

PHP will send email from your own sever, so if you have your own online website you should have a mail server

Enjoy
InsiteFX[/quote]

I don't have any website.


Does dynamic ip causes any issue?
#9

[eluser]eoinmcg[/eluser]
Like I said, I haven't used XAMP, but it sounds to me like you don't have any kind of mail server set up. Did you try with gmail? There is sample code on the page I linked to above :

Code:
$config = Array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => '[email protected]',
    'smtp_pass' => 'your_password',
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");

$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');

$this->email->subject(' CodeIgniter Rocks Socks ');
$this->email->message('Hello World');


if (!$this->email->send())
    show_error($this->email->print_debugger());
else
    echo 'Your e-mail has been sent!';


That should do the job.
#10

[eluser]aryan_[/eluser]
Thanks guys. I have purchased hosting with smtp. Now I'm able to send email.

Thanks again for your kind help.




Theme © iAndrew 2016 - Forum software by © MyBB