CodeIgniter Forums
SMTP Error - Undefined index: Subject - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: SMTP Error - Undefined index: Subject (/showthread.php?tid=25761)



SMTP Error - Undefined index: Subject - El Forum - 12-23-2009

[eluser]mwolf[/eluser]
I am trying to setup email to send via a SMTP service I registered for and I keep getting the Undefined index: Subject error message.

Code:
$this->load->library('email', $config);
        $this->email->from('[email protected]', 'Support');
        $this->email->to('[email protected]');
        $this->email->message('This is my message');
        $this->email->subject('This is my subject');
        $this->email->send();

When outputting print_debuger, I see the following:

Code:
User-Agent: CodeIgniter
Date: Wed, 23 Dec 2009 12:40:52 -0600
From: "Support"
Return-Path:
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
=?utf-8?Q?This_is_my_subject?=
This is my message


I don't see any issues, but it continues to throw the same error.

Code:
A PHP Error was encountered

Severity: Notice
Message: Undefined index: Subject
Filename: libraries/Email.php
Line Number: 940

Any idea what I am doing wrong? Any help is appreciated!


SMTP Error - Undefined index: Subject - El Forum - 12-23-2009

[eluser]Colin Williams[/eluser]
Just for grins, try moving the subject() call above message(). It shouldn't matter, but it's worth a shot.


SMTP Error - Undefined index: Subject - El Forum - 12-23-2009

[eluser]mwolf[/eluser]
Nope, stuck on the same error....


SMTP Error - Undefined index: Subject - El Forum - 12-23-2009

[eluser]Colin Williams[/eluser]
K. It was a shot in the dark. I would get your hands dirty in the email class and start debugging. My first step would be to inspect the array that it is trying to access 'Subject' from. See what's up


SMTP Error - Undefined index: Subject - El Forum - 12-23-2009

[eluser]mwolf[/eluser]
It sounds like this is a bug in code igniter then? I'll see if I can track it down this evening.


SMTP Error - Undefined index: Subject - El Forum - 02-19-2010

[eluser]Unknown[/eluser]
Hi

i am getting same error

Code:
$this->load->library('email');

                $this->email->from('[email protected]', 'Sandeep');
                $this->email->to($this->input->post('payer_email'));
                //$this->email->cc('[email protected]');
                //$this->email->bcc('[email protected]');
                $this->email->subject('Email Test');
                $this->email->message('Testing the email class.');
                $this->email->send();

any solution


SMTP Error - Undefined index: Subject - El Forum - 05-23-2010

[eluser]ch5i[/eluser]
I think there is a bug in Email.php => see this thread