Welcome Guest, Not a member yet? Register   Sign In
Dreamhost + Gmail SMTP + CI
#1

[eluser]Vicente Russo[/eluser]
Helloo fellows, I need a little push here.

I`m trying to send and email with smtp, hosted on dreamhost. The thing is, I dont know where is the problem. I got an 404 error when I execute $this->email->send();

Code:
$this->load->library('email');
            
            
            $config = Array(
              'protocol' => 'smtp',
              'smtp_host' => 'ssl://smtp.gmail.com',
              'smtp_port' => 587,
              'smtp_user' => 'myuser@mydomain',
              'smtp_pass' => 'mypass'
            );

            $this->email->initialize($config);
            

            $this->email->from('myuser@mydomain', 'Vicente');
            $this->email->to('[email protected]');

            $this->email->subject('Email Test');
            $this->email->message('Testing the email class.');

            $this->email->send();

            echo $this->email->print_debugger();

Checking the apache logs, I got "Premature end of script headers: index.php" error.

So what can it be? :S

Thx!
#2

[eluser]Dam1an[/eluser]
When you say you get a 404 error, is this the CI 404 or the real 404?
#3

[eluser]Vicente Russo[/eluser]
CI 404 !
#4

[eluser]Dam1an[/eluser]
Any redirects later on in the function?
#5

[eluser]Vicente Russo[/eluser]
No redirects. The script ends echoing the print_debugger function.

But I added the following line, and it worked:

Code:
$this->email->set_newline("\r\n");

But I don`t know why the CI 404 error showed up. Misteries....
#6

[eluser]Dam1an[/eluser]
I came accross a thread earlier where chanign the newline character to \r\n fixed something as well (can't remember what though)




Theme © iAndrew 2016 - Forum software by © MyBB