Friday, June 3, 2011

Sending bulk emails from your web application - the right way

For us, developers, it’s easy to deal with situations when your application needs to send one or two emails at a time, but is it okay to send hundreds of emails from your hosting server? Usually not and here is why.

First of all there are technical challenges. For example you have to make sure you are not exceeding the limits set by hosting providers (which are not always officially advertised).

Second and the most challenging part is getting around spam filters. If high deliverability is important to you (otherwise why would you even bother sending emails) then you need to start thinking about playing by the rules and implementing techniques like double opt-in, unsubscribe functionality and many other little things.

Unfortunately for you and fortunately for users, anti spam filters are very suspicions and it’s not that hard to get blacklisted. So if are interested in your emails being delivered into your users’ inbox, then the safest bet is let the professionals deal with that and focus on other not less important tasks.

So, now, where should you look for professional services if you need to send bulk emails? Such service is usually called email marketing. Pick carefully. There are many variations and different price points. If you don’t know where to start here are the two companies I had very good experience with: AWeber (www.aweber.com) and iContact (www.icontact.com) . As I already mentioned, I like both companies. I’d say they break even in the set of features they provide. AWeber seems to be the most popular choice - not sure why. Pricing wise iContact is a little bit cheaper, but that’s where you have to make your own comparison based on your needs.

If are not bored to death yet, I just want to mention that respectful companies like those mentioned above have API(s) for developer so if you need to send emails from your web site, you can, but now via reliable service.

Hey one more thing to consider is that email marketing companies can collects stats for you so you can actually see how many people opened your newsletter. Isn’t it cool? ;-)

Amazon ES2 Error "Configuration information could not be read from the domain controller" SOLVED

I've got this error when I tried to change the password on Windows Server 2008 running on  Amazon ES2.

The thing is, I never changed this error before even though I had to change my password many times. What was different this time is that I had problem with server and had to Stop and Start the instance. As a result the name of the instance has changed.  The problem is Remote Desktop had saved the name of the previous instance in the username field in a form "instance name\my name".

Soution:  I deleted the instance name in Remote Desktop and the error has gone away. Hurray!

-=Oleg=-

Monday, February 14, 2011

How to Vacuum Indexes (Java) on App Engine

Note, you need App Engine SDK 1.4.2 or higher.

On Linux:
./appengine-java-sdk/bin/appcfg.sh vacuum_indexes myapp/war

On Windows
appengine-java-sdk\bin\appcfg.cmd vacuum_indexes myapp/war

You need to run this from command line on your local PC. This command deletes all indexes for the app that are not mentioned in the local versions of datastore-indexes.xml and generated/datastore-indexes-auto.xml.

About parameters:

  • appcfg.cmd file is part of GAE SDK and so you have to look for it in the folder where SDK is installed. If you use Eclipse then App Engine plugin is installed under "eclipse\plugins\" folder. There might be several GAE SDK folders in there, so make sure you pick the right version. For example for version 1.4.2 the folder name starts with "com.google.appengine.eclipse.sdkbundle.1.4.2".

  • vacuum_indexes - name of the action.

  • myapp/war  - path to the war folder of your application. You need to specify the full path in there.


 Here is corresponding App Engine doc.

After you execute this command, it's going to ask you if you actually want to delete index or not. See screenshot below. 

[caption id="attachment_100" align="alignnone" width="683" caption="Delete index confirmation"]Delete index confirmation[/caption]

-=Oleg=-

Sunday, February 13, 2011

How to download App Engine logs in Windows

The web interface provided by admin console does not provide a lot of flexibility for analyzing your logs and sometimes you just need to have them locally to study carefully. If you are working on Windows and you feel that information provided in App Engine docs is too short, then this blog is for you.

App Engine Docs say you need to run this:

./appengine-java-sdk/bin/appcfg.sh request_logs myapp/war mylogs.txt

Well this is for Linux. If you are on Windows, here what you need to do:

  1. Find the location of the “appcfg.cmd” on your computer. I use Eclipse and in my case it was here:
    "c:\Program Files\eclipse\plugins\com.google.appengine.eclipse.
    sdkbundle.1.4.0_1.4.0.v201012021502\appengine-java-sdk-1.4.0\bin\appcfg.cmd".

  2. Find the location of your app. You need the “war” folder. Here is what I have on my machine:
    "c:\svn\mysource\myapp\trunk\war"

  3. And the final step is to put it all together. Open command prompt and type:
    "c:\Program Files\eclipse\plugins\com.google.appengine.eclipse.
    sdkbundle.1.4.0_1.4.0.v201012021502\appengine-java-sdk-1.4.0\bin\appcfg.cmd" request_logs c:\svn\mysource\myapp\trunk\war mylogs.txt


This will do the magic of downloading your application logs to your computer. Just be patient because it may take a while. In my case downloading 9 hours of logs (~1,000,000 records) took about 30 minutes.

BTW, if you don’t specify the destination folder then file is downloaded into "c:\Documents and Settings\username\" folder.

BTW2, running appcfg.cmd without parameters will show you a help page where you can read how to specify number of days and minimum log level if you need to. By default it will be 1 day of request logs only.

-=Oleg=-