Skip to Content »

FlashApe » archive for June, 2005

 PHPMailer — its so freaking awesome

  • June 24th, 2005
  • 1:53 am

I love php…most of the time. Trying to deal with sending emails with it is another story. Especially html emails. There’s a lot of headers and crap to set, and if you mess some up the email mgiht not get sent, or caught in a spam filter or something like that.
Enter PHPMailer,easily one of the sickest tools I’ve come across in web developement, even if it’s just for the amount of dev time saved alone.
Here a feature list from the website:
Features
-Can send emails with multiple TOs, CCs, BCCs and REPLY-TOs
-Redundant SMTP servers
-Multipart/alternative emails for mail clients that do not read HTML email
-Support for 8bit, base64, binary, and quoted-printable encoding
-Uses the same methods as the very popular AspEmail active server (COM) component
-SMTP authentication
-Word wrap
-Address reset functions
-HTML email
-Tested on multiple SMTP servers: Sendmail, qmail, Postfix, Imail, Exchange, Mercury, Courier
-Works on any win32 or *nix platform
-Flexible debugging
-Custom mail headers
-Multiple fs, string, and binary attachments (those from database, string, etc)
-Embedded image support
I havent tried any other php-mailing solutions, but I’m not even going to. If you are still sending mail from php script, start using this class today.

 Criticize My Class Diagram

  • June 2nd, 2005
  • 1:53 am

first off, gModeler kicks major ass. Now that that’s out of the way, I want everybody to criticise the crap out of my class diagram for this app I’m building. Here’s the layout, click the thumbnail for the larger image:

The layout may look a little funky becasue i was trying to squeeze everything into the screenshot, but here’s the rundown:
I have a SiteManager class that acts as a psuedo-controller, all the requests go through that.
I have two main superclasses, DynamicOutputter and RecordHandler. Each section of the web site has a corresponding “outputter” class of its own…so for news it would be News_Outputter, and that inherits from DynamicOutputter. The outputters return the formatted output for the page. Each outputter is composed with its corresponding RecordHandler(same deal for the RecordHandlers, each site section has its corresponding record handler that handles communication with the database, and inherits from the RecordHandler superclass). Each RecordHandler’s sublcass overrides one method, setValueArray(), which sets its values, which are the names of the rows in the table it will be dealing with.
When the SiteManager recieves a request, it uses a factory (either DynamicContentFactory or RecordHandlerFactory) to determine which sections class to instantiate, bases on a given id parameter.
If anything else isnt clear, just ask, otherwise, fire away, as long as its constructive criticism.