Simple Invoices logo
    • CommentAuthorrkolech
    • CommentTimeOct 21st 2009
     permalink
    Hello,

    I am new to this application and I am trying to get it set up for the first time. I have everything working accept the e-mail functionality. Whenever I try to email and invoice I get the following error:

    Fatal error: Out of memory (allocated 32243712) (tried to allocate 837194 bytes) in ....../simpleinvoices/library/mail/class.phpmailer.php on line 1126

    This is the actual line:
    /* chunk_split is found in PHP >= 3.0.6 */
    $encoded = chunk_split(base64_encode($str), 76, $this->LE);

    I have created a PHP.ini file to overwrite the default values of my Host. I have no problems creating PDF files. I have put a copy of the PHP.ini file in both the root simpleinvoices/ folder as well as the /simpleinvoices/library/mail/ where the php file in question is located.

    Could this error be caused by invalid smtp settings in the config file? Since I have never been able to send an email I can't verify that these settings are correct.
    Does anyone have any ideas? Thanks.
    • CommentAuthorjustin
    • CommentTimeOct 22nd 2009
     permalink
    hey rkolech

    if your host doesn't allow email out - i know my old host didn't allow this - than this may be causing the - but i not 100% sure on that

    have you entered a username/password etc.. for smtp in the config.ini file?

    cheers

    justinSmarterInvoices.com Simple Invoices hosting | SixHQ.com Simple Invoices custom development | Me
    • CommentAuthorrkolech
    • CommentTimeOct 22nd 2009 edited
     permalink
    Thanks for your reply Justin
    I am trying to use the gmail smtp server. Here are the settins that I am using, got the details from the gmail website:

    email.host = smtp.gmail.com
    email.smtp_auth = true
    email.username = my_address@gmail.com
    email.password = gmail_password
    email.smtpport = 587
    email.secure = ssl
    email.ack = false


    Has anyone used gmail successfully with this application? As for my host, they do allow email, and they also have an smtp server. As of right now I don't have any mailboxes set up with them though, they are just forwards to my gmail.
    • CommentAuthorjustin
    • CommentTimeOct 23rd 2009
     permalink
    hey rkolech

    gmail is a pain to use with phpmail (the php class we are using for email) once we swap to zend_mail will be ok

    so basically i don't think you'll get Simple Invoices working with gmail smtp
    - ask your host - maybe you can use their smtp server

    cheers

    justinSmarterInvoices.com Simple Invoices hosting | SixHQ.com Simple Invoices custom development | Me
    • CommentAuthorrkolech
    • CommentTimeNov 5th 2009
     permalink
    Hello Justin,

    I have tried to use my hosts mail server and still no luck, the issue seems to be with the mail class running out of memory, I put bad data into the config file to see what error I would get, and it was totally different. So I am guessing that the settings are correct.

    I then got a newer version of phpmailer but still getting the exact same error, but now its on a different line number as the code has changed and that line has moved. I am all out of ideas at this point. I notices a Zend folder in the library folder. Can I configure the application to use Zend instead of phpmailer?

    Thanks.
  1.  permalink
    • CommentAuthorjustin
    • CommentTimeNov 6th 2009
     permalink
    @rkolech
    re zend
    - you can try - you have to redo all the Simple Invoices email code - refer post below
    -- if your interested in doing this - would be a great help to Simple Invoices

    @starscream
    - might be quicker to swap phpmailer for zend_email
    -- just need to redo the email code in http://code.google.com/p/simpleinvoices/source/browse/trunk/modules/invoices/email.php

    cheers

    justinSmarterInvoices.com Simple Invoices hosting | SixHQ.com Simple Invoices custom development | Me
  2.  permalink
    You're right Justin, moving to Zend Email would fix it. Will take a look at it next week, if rkolech doesn't answer anymore.
  3.  permalink
    I've finished the implementation. Anyone who wants to test it before I commit it? Gmail seems to work for me now. I only couldn't implement ACK, what's it used for? Also there seems to be a problem when I catch exceptions, so the error handling is a bit nasty.

    Regards Starscream
  4.  permalink
    Oke, I just committed it for everyone. The exception handling is fine now, BTW.
    • CommentAuthorjustin
    • CommentTimeNov 9th 2009 edited
     permalink
    thanks !!!

    note: http://code.google.com/p/simpleinvoices/source/browse/trunk/modules/invoices/email.php?spec=svn2672&r=2672#13
    - shouldn't need that error_reporting as is defined in config.ini

    cheers

    justinSmarterInvoices.com Simple Invoices hosting | SixHQ.com Simple Invoices custom development | Me
    • CommentAuthorjustin
    • CommentTimeNov 9th 2009
     permalink
    re ACk
    - this was for read recipts of emails
    - not sure if zend_mail can do read receipts

    cheers

    justinSmarterInvoices.com Simple Invoices hosting | SixHQ.com Simple Invoices custom development | Me
  5.  permalink
    Committed the new version. Couldn't find ACK support in the documentation nor in the code..

    PS: For Gmail set the 'email.secure' configuration to 'tls' instead of 'ssl'.
    • CommentAuthorjustin
    • CommentTimeNov 10th 2009
     permalink
    thanks

    you can remove the email.ack property from config.ini if you want

    cheers

    justinSmarterInvoices.com Simple Invoices hosting | SixHQ.com Simple Invoices custom development | Me