Welcome Guest, Not a member yet? Register   Sign In
Sending Mail
#1

[eluser]Michael Nielsen[/eluser]
I'm using the CI email library and can't get a single email sent.

This is my controller:

Code:
<?
class Email extends Controller
{
    function Email()
    {
        parent::Controller();
    }
    function index()
    {
        $config = Array(
        'protocol' => 'smtp',
        'smtp_host' => 'ssl://smtp.googlemail.com',
        'smtp_port' => 465,
        'smtp_user' => 'xxx',
        'smtp_pass' => 'xxx',
        'mailtype'  => 'text',
        'charset'   => 'iso-8859-1',
        'wordwrap'  => TRUE
        );

        $this->load->library('email', $config);
        $this->email->set_newline("\r\n");

        $this->email->from('xxx');
        $this->email->to('xxx');
        $this->email->subject('This is an email test');
        $this->email->message('It is working. Great!');

        if($this->email->send())
        {
            echo 'Your email was sent, fool.';
        }

        else
        {
            show_error($this->email->print_debugger());
        }
    }
}
?>

I'm using Google Apps to host my email so I'm assuming I can use it to send emails from my company domain instead of a @gmail.com.

I'm also generating a whopping 14 errors when I execute the controller.

Code:
A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

Filename: libraries/Email.php

Line Number: 1652

Theres about 3 million fgets and fwrites errors.

Code:
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1795

Code:
A PHP Error was encountered

Severity: Warning

Message: fgets(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1818

Code:
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\system\libraries\Exceptions.php:166)

Filename: codeigniter/Common.php

Line Number: 360

thanks in advance.


Messages In This Thread
Sending Mail - by El Forum - 10-24-2009, 06:10 PM
Sending Mail - by El Forum - 10-24-2009, 10:53 PM
Sending Mail - by El Forum - 10-24-2009, 11:06 PM
Sending Mail - by El Forum - 10-24-2009, 11:09 PM
Sending Mail - by El Forum - 10-24-2009, 11:18 PM
Sending Mail - by El Forum - 10-24-2009, 11:22 PM
Sending Mail - by El Forum - 10-24-2009, 11:26 PM
Sending Mail - by El Forum - 10-24-2009, 11:31 PM
Sending Mail - by El Forum - 10-24-2009, 11:48 PM
Sending Mail - by El Forum - 10-25-2009, 12:04 AM
Sending Mail - by El Forum - 10-25-2009, 01:36 AM
Sending Mail - by El Forum - 10-25-2009, 09:46 AM
Sending Mail - by El Forum - 11-21-2009, 08:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB