breandan81 Posted December 31, 2010 Share Posted December 31, 2010 Ok, so I am writing a module to email people license keys that I generate. I'm using the open source library truelicense, and the keys are binary files, so I need to send them as attachments. In order to do this more easily I am using the pear Mail and Mail/mime libraries. That's where the problem started. The module has the following functions:__construct_displayFormgenkeygetContenthookupdateOrderStatusinstallsendKeyin order to test it I just made a dummy order paid for with paypal sandbox, and I go to the back office and set the order status to payment accepted to trigger the module. sendKey is the only one that needs the pear stuff, so it was the one I wrote last. When include_once('Mail.php');include_once('Mail/mime.php');isn't at the top of the file, and sendKey is left blank, the module doesn't send a key, but it does exit just fine and go back to the order screen and the payment status is updated. As soon as I include Mail and Mail/mime, it doesn't return to the order status screen anymore, like the script has an error in it. But the whole module seems to work, I get my key mailed to me as an attachment, I get an email notifying me that someone bought something that required licensing and telling me what commandline was used and where the file was saved, I even added a line to mail me at the end of hookupdateorderstatus that everything was finished, and it gets to there. Is there some trick to this? licensedistributor.php Link to comment Share on other sites More sharing options...
breandan81 Posted December 31, 2010 Author Share Posted December 31, 2010 OK, I changed the code to not need the Mail.php and Mail/mime.php, but I'd sure like to know what the trick is to including things like this anyway for future projects. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now