Welcome Guest, Not a member yet? Register   Sign In
$this->email->subject() bug?
#1

[eluser]Iverson[/eluser]
I'm sending an SMTP email using the email lib. I'm setting the variable like normal($this->email->subject($subject).

Code:
$subject = 'Email Test 2'   // works
$subject = 'Hey!' // doesn't work

WTF? Both return a success message from the debugger. I would include other details like config variables, but I don't see how they should be related in any way! FYI, I'm on a Windows 2003 box.
#2

[eluser]Cro_Crx[/eluser]
If your sending more than one email in one controller or looping, it may be a good idea to reset the email variables, that should hopefully fix your problem.

Code:
$this->email->clear()
#3

[eluser]Iverson[/eluser]
[quote author="Cro_Crx" date="1242076907"]If your sending more than one email in one controller or looping, it may be a good idea to reset the email variables, that should hopefully fix your problem.

Code:
$this->email->clear()
[/quote]

No loop. Just one email. Copied exactly from the user guide example.
#4

[eluser]Cro_Crx[/eluser]
The only thing I can possibly think of is remove the exclamation point! lol

if
Code:
$subject = 'Email Test 2';
works
Code:
$subject = 'Hey!';
should work as well.
#5

[eluser]squarebones[/eluser]
According to the email library, in the _prep_q_encoding function, which is acted upon the subject (and probably other email parameters), any special characters are being converted to hex representations or other short cuts that make it compatible with the email protocols (I assume). So that exclamation point is being converted to something else. Which doesn't mean it shouldn't sent the email, only that it may or may not contain that exclamation point. There is no apparent break point in that function that would stop the email from being sent. Am I wrong about this?

The short answer...as the doctor says when you tell him it hurts to do something, don't do it. Or use the native PHP email library to send emails and bypass CI's safety nets.
#6

[eluser]theshiftexchange[/eluser]
Do a process of elimination.

Try
Code:
$subject = 'Hey';

Assuming that works, try this line (note the " " used)

Code:
$subject = "Hey!";




Theme © iAndrew 2016 - Forum software by © MyBB