Send HTML emails using PHP with Ease
June 28th, 2008One of my clients recently asked for an email newsletter type solution where they remotely send an email address via XML to a PHP script that would then send an HTML email template off to that specific email address. I spent some time looking around at different solutions only to find that apparently no one had a solution that would meet our needs - that meant writing the script from scratch!
To send HTML emails using PHP (vs just sending a text email), what you will need to do is use PHP’s “mail” function and place the proper headers into the mail function’s “headers” field (see PHP’s mail function defenition for more info). Here is an example:
mail($email, ‘Resource Nation’,
$body,
“From: <$from>\n” .
“MIME-Version: 1.0\n” .
“Content-type: text/html; charset=iso-8859-1″);
Just replace the $email and $from variables to your liking. You can also read up in more detail on how to construct emails using PHP but my above code is a quick and easy solution for those looking to just sent emails that contain HTML. Happy HTML-emailing!
Process HTML files as PHP files
June 24th, 2008In your .htaccess file (*nix servers only) you will need to place the following two lines:
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
From here on out your .htm and .html pages will be processed as PHP files by your web server but without actually having to use the .php extension on a given web page to run PHP code. Pretty handy stuff if I do say so myself - this way you don’t have to 301 redirect a bunch of html pages if you wanted to start utilizing PHP
to pull in some template code within your existing html files.
5 Useful Wordpress Plugins
December 1st, 2007I’ve setup a number of wordpress web logs in the past and have found several plugins to be very useful:
- All-In-One-SEO-Pack: This handy pluggin helps you to place title and meta descriptions, among other things, into your blog pages to make them a little more SEO friendly. You may be surprised by the ranking increases your site can have with just a few minor tweaks to the title tag of your home page.
- Popularity Contest: A very feature packed analytics type plugin allowing you to show which posts on your blog are the most popular. This can help serve up content that people would be interested in reading but would otherwise never find on your site because they we’re originally looking.
- Sociable: Allows your users to easily submit your content to social networks, helping to spread your message.
- Wp-Cache: Makes your wordpress pages load faster via page caching. This can be good if you’re pages get popular on social media sites that have a HUGE amount of traffic, i.e. digg
- FeedBurner FeedSmith: Redirects your RSS feeds to FeedBurners feed service (now owned by Google). If your blog has interesting content and has real readers, you will want to use feedburner as Google may now be using your subscriber data as a signal of quality, helping your search engine results.
Thinking about a Computer Science Degree?
December 1st, 2007Ever since I was a little kid I knew I wanted to work with computers, be it computer science or software engineering or something similar. I ended up graduating college with a degree in computer science but found myself wondering what other degrees were out there that were computer related. There are actually several options according to the 6 degrees of computer science article.
“A common confusion among high school seniors interested in computers
has to do with too many, often similar, options available for pursuit
in higher education. What is the difference between Computer
Engineering, Software Engineering, and why is neither the same as
obtaining a Computer Science degree?”
Below is a graphic depicting how the computer science major relates to similar majors that deal with computers:
