Bug with Email Class: Undefined Subject, although it's sent!!! |
[eluser]Isos[/eluser]
Hello. I am getting a strange PHP error when using Email Class. In the email I am sending I have specified the Subject, after sending email arrives with the subject I've specified, yet I am getting this error on the web page when I fire-up the function: Code: A PHP Error was encountered Please tell me how can I solve this?
[eluser]Tom Glover[/eluser]
Check your controller file have you set the index, of subject in there, it has to be set otherwise the error will keep appearing, even if it is an empty index ' '.
[eluser]Isos[/eluser]
If you mean by index : $this->email->subject('') .. sure!! I just told, I am receiving the email with the subject! so I have it like this: $this->email->subject($msg_subject) .. Here is the function I am using : http://paste.mycodenow.com/view/27790c69 I am currently discussing that in IRC #codeigniter.
[eluser]Tom Glover[/eluser]
I'm sorry but i don't no what else it could be, someone else will have a solution though.
[eluser]Colin Williams[/eluser]
Code: // -------------------------------------------------------------------- If you don't ever call subject(), then yes, you will probably see an error from line 930. Odd that the class doesn't do a check first (I don't think Subject is a required email header, is it?)
[eluser]Colin Williams[/eluser]
Can you provide code that consistently throws this error in the latest version of CI? I certainly can't reproduce it.
[eluser]Tom Vogt[/eluser]
[quote author="Colin Williams" date="1217826989"]Can you provide code that consistently throws this error in the latest version of CI? I certainly can't reproduce it.[/quote] Code: function invite() {
[eluser]jrlooney[/eluser]
Hey Colin, I am hitting the exact same error on the same line (930). To recreate the problem - try sending to a group of 90+ email addresses - that is when I see it happen. The first 30 or so get sent out fine, with the Correct Subject showing, but then not only does the Subject disappear and errors start getting thrown, but also the HTML body gets garbled. See these two screengrabs, both the same message, both sent in the same batch. Good HTML Email received: http://i285.photobucket.com/albums/ll64/...ure3-1.jpg Garbled HTML Email received: http://i285.photobucket.com/albums/ll64/...ure4-1.jpg "Error" output by CI: http://i285.photobucket.com/albums/ll64/...cture5.jpg
[eluser]jrlooney[/eluser]
NOTE - if i change the protocol setting in the config from mail to sendmail, the "Subject" problem goes away, however the HTML is still getting garbled Can you think of a way I can troubleshoot this w/o sending out the messages, and somehow seeing the values CI is trying to use for each block of 20 messages before it sends them to sendmail (any way to see if it's a CI problem or a sendmail problem)?
[eluser]jrlooney[/eluser]
Just got another clue. It appears to be related to bcc_batch_mode & bcc_batch_size I was sending to 90 email addresses and getting the errors described, this was when bcc_batch_size was set to 20. I just changed it to 100 and all 90 messages went out fine. Can someone from CodeIgniter please look into it and help me understand a fix, or let me know if it'll just have to be logged as a bug and taken care of in the next release? |
Welcome Guest, Not a member yet? Register Sign In |