How The Shawshank Redemption Tanked in Theaters

June 21, 2010 08:48 by Admin

Written by Scott Graveline (guest blogger):

When it comes to great movies, word of mouth is a good thing—maybe the best of things.  

“We couldn’t pay people to see The Shawshank Redemption in theaters,” director/screenwriter Frank Darabont once confessed. I had the pleasure of meeting Darabont, and I didn’t even care that he sparked up a cigarette-or-clove-or-whatever-it-was indoors while we talked. I almost boasted to him that I actually saw Shawshank on the big screen, but that would be like winning the “last one awake” contest at a sixth-grade sleepover—a solitary celebration indeed. However, his box office bomb miraculously went on to become one of the highest-grossing rentals of all time. This anomaly has fascinated me for years.

Shawshank: Warming the Cockles of Countless Souls
The Shawshank Redemption ranks among my top three film experiences of all time, rubbing elbows with Casablanca and The Godfather saga. I’m not the only one. It’s hailed as a heartfelt favorite by scores of casual and serious moviegoers. A high percentage of people I meet—guys especially—have carved out a special place for this film. A few years back, my former roommate and I were under its spell weekly. Most twentysomethings who choose the couch over life’s responsibilities do so because of the hippie lettuce; we only had TNT and its steady rotation of the addictive prison saga to blame.

Even actor Tim Robbins claims that fans talk Shawshank with him more than anything else in his body of work. Some have called the film life changing. The critics are also on board; the gripping drama is ranked in numerous greatest films of all time lists and was nominated for seven Academy Awards.

Sneaky Powerful, Sneaky Unconventional
Seeing Shawshank for the first time is like going to the DMV and meeting your future spouse; you’re completely ill-prepared for such a momentous occasion. I can rave about the film’s message of hope, deliverance, restitution, and freedom for days, but I’m more impressed with its subtle escape from predictable movie formulas. The film ranks among the greats despite:

  • No present female love interests, save for a poster of “fuzzy britches”
  • Two lead male characters who develop an authentic friendship and seldom quarrel
  • All that screen time in one dismal location
  • A covert 20-year escape plot of which the audience is not aware
  • Prison rape (never fun)

 

So Where Was the Box Office Love?
Let’s take an inventory: Critical acclaim? Check. Joe Moviefan acclaim? Check. Recognizable actors? Check. Released in a theater near you? Check. Then why did this now-beloved film take in a box office gross so paltry that it barely covered its $25 million budget? Let’s get busy hypothesizing…

Pulp Gumption
Turns out, 1994 churned out some fine movies. Juggernauts such as Pulp Fiction and Forrest Gump boxed out Shawshank for Oscars nods. The Lion King, True Lies, and Speed were also killing it in theaters that year. Is a crowded box office reason enough to completely disregard a brilliant movie offering? If anything, I’m fired up to see more movies after I view something gripping or thought-provoking.

Even though a film’s marketing budget is always a factor, I’m not focusing on that here because: a) Exceptional low budget independents like Pulp Fiction get seen and b) I’m entirely too lazy to research it. Get this: some of the inferior films that out-earned Shawshank in ’94 include: In the Army Now, Richie Rich, Timecop, Street Fighter, and, gulp, A Low Down Dirty Shame. Indeed it was a shame. 

Share of blame: 5% 

The Stephen King Non-Horror Scare
Hey, Robert Mondavi is experimenting with beer now; eager to spend your hard-earned cash on it? This is the best analogy I could come up with to explain the Stephen King brand being attached to a non-horror movie in 1994. King’s hope-driven prison novella was without bloody prom queens, resurrected rabid pets, or psycho killer clowns.

However, after Shawshank grew astounding rental and cable legs—and the world accepted King in such a genre—Darabont adapted King’s The Green Mile and it generated over $136 million. It was solid, but can it make you at one with your couch this weekend? I don’t dare put too much weight on the King factor contributing to Shawshank’s maiden failure; nobody goes to movies for the writers, except the writer’s mom. 

Share of blame: 10% 

The Poster Featuring Morgan Freeman’s Rerun Beret
The primary Shawshank movie poster displayed a rain-soaked, quasi-homoerotic close-up of Robbins and Freeman. And Freeman was modeling a backwards beret that played much cooler in the movie than the poster. The title and poster gave us no hint of incarceration, tribulation, corruption, escape, or general awesomeness. Instead, it gave us an all-male cast of Singin’ in the Rain 2. Was a studio insider sabotaging this thing? When men—the demographic that would later make the movie famous—saw this poster, it didn’t have a prayer. 

Share of blame 30% 

Worst Title Ever
When I first fell in love with the film in ‘94, I quickly devoured the Stephen King novella, Rita Hayworth and Shawshank Redemption. The good news is that Darabont and company dropped the lengthy, confusing title for the movie adaptation. The bad news is they replaced it with an abridged version that was equally repulsive and perplexing. Absolute box office poison. If I cut a dog crap sandwich in half, is it any more appealing to you? Don’t get me wrong, this title plays after you’ve seen the film, but it sucks on a movie marquee that features 19 better-titled films.  

I was a teenager working at Blockbuster at the time Shawshank found its remarkable second life in the rental market. Its resurgence was insane—all word of mouth. Droves of customers would request the film, and less than half could pronounce it. Shank-shaw Redemption was the most common error. My porn-minded associate called it Schlongspank Redemption, but I think he had his own thing going on. 

Share of blame: 55% 

Conclusion
Much like Andy Dufresne, The Shawshank Redemption was set up for failure. Some good films survive weak titles or minor marketing gaffes, but this campaign had numerous somebody-better-be-fired blunders and paid for it in theaters. Just imagine if a picture of this caliber was released before rental and cable—only astute film professors would reference it in passing. One thing’s for sure: The Shawshank Redemption crawled through a river of box office excrement and came out clean on the other side.


Currently rated 2.9 by 28 people

  • Currently 2.892857/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Review | Fun | op ed
Actions: E-mail | Permalink | Comments (8) | Comment RSSRSS comment feed

Health Care Reform Bill - Socialism, Communism, Marxism or another ism?

April 13, 2010 07:29 by bjones

This blog is not going to debate the positives or negatives about the Health Care Reform Bill. I'm not going to give you my views either way (although I'm sure you can figure them out). Instead, this blog is to help educate people and take away their crutch so they have to think for themselves. Once we start thinking for ourselves, we will become a better society.

For the past few months we've heard non-stop news about the anger of people over our Health Care reform. They say that the reform is Socialist, Communist and even Marxist. Before someone just regurgitates what the talking heads on Fox News tell them, they should learn the meaning of the words. If they do, they might be able to articulate their issues and have a decent, civilized conversation about their views.

The big, overarching theme about the Health Care reform is that it's too much government. It's our government telling us what we can and can't do. It's them controlling our health care. Key phrases to remember for the rest of this blog: "too much government" and "controlling our health care."

Now, let's define Marxism, Socialism, and Communism; all of which are a different degree of Socialism.

Marxism is comprised of three main characteristics. First, it requires no government; no controlling body. If something needs to be done, someone or some group steps in (not directed by a controlling government) and does it for the greater good. Secondly, there is no private ownership of anything. If there is something needed, you just take it. Finally, there is no religion in Marxism. Marxists belie that religion was created by the uber rich to keep the masses happy about a meager existence.

Socialism is similar to Marxism for the masses but one big exception: government. There is a government that owns everything while the masses own nothing. Because the masses own nothing, they are expected to do whatever is necessary for the greater good. Socialism is a stepping stone to Marxism because after the masses have been "trained" to do everything for the greater good, the government dissolves and leaves the society in a Marxist state.

Communism was initially Marxism. However, Marxism was a Utopia that could never be achieved and Communism became known as a failed, corrupt, uber-socialist society.

Every Socialist society has some industries that the government has taken from the private sector. Every government (yes, even the US) has some degree of socialism because there are some things that the private sector just can't do.

This blog is not to look at why these societies ultimately fail (think: human nature, corruption and lazy people) but rather why the Health Care Reform cannot be labeled as any of these. Fist, people are saying there is "too much government" in the Bill. If that's the case, it cannot be Marxist because Marxism has no government. Secondly, people are saying that the government is taking over health Care with this Bill. This is false. The government is not controlling the industry, just requiring people to buy something controlled by the private sector. That takes out Socialism and Communism.  Finally, all forms of Socialism would make health care free.  This bill does not make health care free.  We will still be paying our own money to a private insurance company.  Want to know the real, dirty secret that the Republicans aren't telling you? The Health Care Bill is the best thing to happen to Capitalism! Capitalism is defined as a society where the private sector makes money without government interference. So you can't call the Bill Capitalism because government is interfering. But, what is the ultimate goal of a company in a Capitalist society? To have every man, woman and child as your customer so that you can make the most money possible. Isn't that what we've achieved here?

I'm not even aware of a term for a government supplying a private industry with every possible client they can have. But, I can assure you that throwing around terms like Socialism, Communism and Marxism to describe the Health Care Reform Bill will make you look stupid.

Lastly, let's not forget that the government is not taking over health care. They are not providing a "Public Option." Even if they were, that wouldn't be socialism because they aren't taking over the industry but instead, creating competition within the private sector. So please, don't walk around saying that you don't want your health care to be run like the DMV. If anything, read this article about why it would probably be more efficient if it were run like the DMV.


There are volumes of books that make up the definition of the three types of societies I have summurized above. If you are using them to describe the Health Care Reform Bill, you obviously don't read referrences or look up definitions. Instead, you will just take my word for it blindly. But, just in case you've made it this far and want to read more, here are some wikipedia links:
Marxism
Communism
Socialism


Currently rated 2.7 by 19 people

  • Currently 2.736842/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Get rid of the Language Bar in XP for good!

February 2, 2010 04:29 by bjones

I'm running Windows XP and I only have 43k pixels on my toolbar without extending it to two or more lines.  I only speak, read and type in English (I'm sure that sentence alone speaks loudly about the education in the US) which means I don't need to lose 10% of those pixels to a language bar.  If you right click on the task bar and go to toolbars, you will see a selection for "Language bar".  Deselecting that will make it go away until you reboot and it comes back!  How do you permanently get rid of it?  Here's how:

 

  • Go to your control panel and make sure you are in classic view.
  • Open up the "Regional and Language Options"
  • Select the "Languages" Tab at the top
  • Click the "Details" button in the "Text services and input langauges" box
  • Click the "Langauge Bar..." button in the bottom "Preferences" box
  • Uncheck "Show the Language bar on the desktop"


That's it! 

 

Now I have extra room to have IE, Firefox, Chrome and Safari all in my quick launch bar ;)  I'll save my rant about all the different browsers for another day.

 

 

 


Currently rated 2.9 by 9 people

  • Currently 2.888889/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: ,
Categories: SysAdmin
Actions: E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed

ZAG zigs on their "guaranteed, no hassle" car pricing

December 3, 2009 10:35 by bjones

We've recently outgrown our 4 door sedan and decided it was time to upgrade to a SUV/Crossover.  We reserached and drove 5 of them before deciding on the Mazda CX-9.  Our insurance company offered a new car buying service through ZAG.  ZAG is a thrid party that negotiates pricing with dealerships and then offers you a "guaranteed, no-haggle price."  They email you a "Pricing Certificate" that you take to the dealership who then sells you the car at that price.  On ZAGs website (zag.com) it says "... allows us to guarantee upfront pricing and a sales experience that is fast, predicatble, and hassle-free."

 

We drank their cool-aid and built the car on their site that we wanted.  I researched the inventory at our local Tustin Mazda and found a 2009 CX-9 Sport Black with Black interior and power/heated seats.  ZAG's pricing showed that Tustin would give us $5,800 below invoice!  Not MSRP but, dealer invoice.  Our total price would be $22,971 for a car with a $31,000 sticker price.  I printed the Pricing Certificate and headed in to Tustin Mazda.  I sat down with the sales person, handed him the inventory for their website and the pricing certificate and said "I want this car at this price."  He went to talk with his manager and came back saying "I don't know where you got that inventory but we sold that car months ago.  We don't have any 2009's left but we can get close on a 2010 if you want."  I thought it was BS but said "fine, what's the price?"  I went outside with Cherish and Ainsley while he went to talk with a manager again.  While we were out there I spotted a Black, 2009 CX-9.  I checked the VIN and it was the exact one I had printed and asked to buy.  I went inside to see what they would come up with on the 2010 (just in case it was going to be really close in price) and wasn't going to mention the car out front right away.  They were $6,000 over what the $22,971 that we had intended to pay.  Not sure how they considered that "close" but, that's another story.  I then told him I saw the car outside so we went outside to verify the VIN and indeed, it was the exact car.  This is a perfect example of a bait and switch program; they have a car online for a certain price and when you get there, they try to sell you the newer model at more money while lying about their inventory.  Very disappointing from a dealership that has a good reputation.  

We went back inside while the salesperson asked about the car.  He came back about 10 minutes later to tell me that they couldn't sell it to me for my guaranteed, no-haggle price and that it was going to be $2,000 more.  I asked for his manager who came out and gave me some story about how ZAG messed up on the pricing.  I said, "I don't care who messed up.  This is a guarantee so, I want that car at that price."  I knew I was getting in to a losing battle so we walked out.

The next day I contacted ZAG and asked them if they were going to stand by their guarantee.  They said they would research the pricing and get back to me.  About an hour later they came back and said that the dealership was correct, there was an incentive that was being counted twice on ZAG's website and that the price was $1500 more, bringing it to $24,471.  I pushed them on the "guaranteed" price and they wouldn't do anything.  So, they say there is a guarantee but there is actually on guarantee.  They blamed the dealership for putting in the wrong price.  I searched and found that dealerships all across the country had the exact same price so it wasn't Tustin Mazda, it was ZAG's fault.

I ended up talking with Jim Feinstein, the owner of Tustin Mazda, and we talked through the issues.  He was a little upset when I told him I felt I had been a victim of bait and switch but, anyone reading this blog, tell me if you would have though anything different.  I provided a price (that they didn't want to honor) with a VIN number they looked up in their computer and then claimed it was sold months ago.  Only after I found the car myself did they cough up to the fact it was there and that they didn't want to honor the price.

Who is to blame?  Mazda USA?  Tustin Mazda?  ZAG?  I think ZAG.  I'm shocked that they wouldn't honor their guarantee!  How can you base your entire company on a simple guarantee and then not honor it?  I wonder what their investors would think if they knew that the single item that allows them to be in business is a lie.

I recommend staying away from ZAG.  It doesn't give you any guarantee and frankly, it added 3 extra days of headaches than if we had just went in to negotiate to begin with.

After all of our hassles, Jim and I came to an understanding and negotiated a good deal.  It wasn't the $22,971 but it was within a few hundres dollars.  We love our new car!


Currently rated 2.7 by 6 people

  • Currently 2.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Surprise, Surprise! Mortgage Modifications Moving At A Snail's Pace

August 4, 2009 05:27 by bjones

Today MSNBC.com has a front page (above the fold/scroll) headline: Mortgage modifications moving at snail's pace.

We've been discussing this since Dec. 11, 2008 on my blog here: http://www.4bcj.com/4bcj.com/post/2008/12/11/Wells-Fargo-Mortgage-Loan-Modification.aspx#comment. To date that blog has generated 40 comments from 5,546 page views and not one is from a happy Wells Fargo customer.  I've tried to get some media attention about the problem but no news outlet would respond to the idea. It's bigger than just "moving at a snail's pace," people are hurting their credit and losing their homes because of the recommendations from Wells Fargo to stop paying their mortgage!  Why isn't the media reporting that?  How about Chris Hanson doing a "to catch a predator" on Wells Fargo instead of going after the 7/11's in the world that are taking away lottery winnings (which is horrible too!).

Hopefully MSNBC's article will help everyone that is about to lose their home but, I wouldn't hold my breath if your mortgage is through Wells Fargo.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Mortgage | op ed
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Cash for Clunkers - FAIL

June 24, 2009 09:16 by bjones

Starting in July, you can trade in your old "clunker" for a new car and receive a $3500 or even $4500 voucher. The purpose of this bill is to put more fuel efficient vehicles on the road and get rid of guzzlers. It sounds like a good idea but their oversites have failed to make it a great idea and therefore have failed completely.

What would have made it better?

  • Why just improve gas mileage? Why not improve emissions too? A car from 1990 has a higher emissions standard than a 2010 model. Why not get rid of the 1990 car and get a cleaner burning car on the road?
  • Why not use this as a time to help stimulate the economy and help the failing car manufactures? Since it’s the US tax dollars that are paying for the vouchers, why not have given an extra bonus for buying a GM, Ford or Chrysler?

 

There are so many problems with the implementation that the program is worthless. First, you have to trade in your old car for a new one that improves the combined fuel economy by at least 2 MPG for light duty trucks and 4 MPG for passenger cars. If you improve your truck or car by 5 or 10 MPG, respectively, you will get the full $4,500 voucher. Why is the 2/4/5/10 MPG a problem? Because, in 2008, they changed the way they rate MPGs of cars. Starting in 2008 the EPA changed the rating to be at a faster speed, faster acceleration, air conditioner on and colder outside temperatures. This means that the new car ratings are more accurate but what it really means is that the MPG rating for your "clunker" is going to be inflated and makes it almost impossible to achieve the improvements needed for the voucher.

My dad has a 1993 GMC Sonoma truck. It’s considered a light-duty truck and therefore requires a 2/5 MPG improvement for the vouchers. The best way to describe his 16 year old truck is to call it a clunker. The EPA says it gets a combined 18 MPG. In order for him to qualify for the $3,500 voucher, he will have to buy a vehicle that gets 20MPG or better. Good luck finding that in a truck. After calling the NHTSA, they recommended he buy a sedan or a hybrid truck. Get real! A GMC Sierra Hybrid starts at $39,365 and it’s rated at 21/22 MPG for a combined 21 MPG. The non-hybrid GMC Sierra starts at $20,350 and is rated at 15/21 MPG for a combined 18 MPG. That means a 3 MPG improvement costs $20,000. The improvement in emissions and gas mileage are virtually nil. The improvement over a 18 MPG GMC Sierra and his 1993 GMC Sonoma are a real 3 MPG improvement (real, not over inflated EPA ratings) and a huge improvement in emissions.

The government is not encouraging my dad to buy a new truck. Therefore they are not:

  • Getting rid of a large polluting vehicle
  • Improving real gas mileage
  • Stimulating the economy.  For a bankrupt American car manufacture!



-FAIL-

 

 


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Rant | op ed | Politics
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Prepoulate a form with data from a DataTable in .net

June 3, 2009 05:42 by bjones

Abstract

A simple .net class that will prepopulate form data on a page.  My requirements were to be able to find a control anywhere on a page (with or without a masterpage) and still be able to control the look of the form.  I did not want to dynamically create the controls because I want to easily control the look of the form without adding any metadata in to the database.

 

Meat and Potatoes

Inevitably when building a website I will have a page (or multiple) that should display information about an item, account, person, etc.  For example, I always have a "My Account" page where I will show the user data we have collected that could be everything from their name and email address to their shoe or ring size.  There could be a dozen or more fields displayed.  Some fields may be read-only (Label) and some may be editable (TextBox).  I start out building the page in the designer with a table and then adding all of my fields as either a TextBox or Label.  Then, I switch to the code behind and poulate a DataTable with the information I need.  The DataTable is always a single row with all that person's data.  I then have to type all the fields names and set their Text value to the DataTable's records.  Rinse and repeat, ice the wrist, rinse and repeat, etc.

In the .aspx page I may have:

[code:c#]

<table border="0" cellpadding="10" cellspacing="0">
    <tr>
        <td align="left">First Name</td>
        <td align="left"><asp:Label ID="aFName" runat="server" /></td>
    </tr>
    <tr>
        <td align="left">Last Name</td>
        <td align="left"><asp:Label ID="aLName" runat="server" /></td>
    </tr>
    .
    .
    .
</table>

[/code]

In the code behind I would then have to do this:

[code:c#]

aFName.Text = dt.Rows[0]["aFName"].ToString();
aLName.Text = dt.Rows[0]["aLName"].ToString();
aEmail.Text = dt.Rows[0]["aEmail"].ToString();
aDisplayName.Text = dt.Rows[0]["aDisplayName"].ToString();
aCellPhone.Text = dt.Rows[0]["aCellPhone"].ToString();
aSignUpDate.Text = dt.Rows[0]["aSignUpDate"].ToString();
atDesc.Text = dt.Rows[0]["atDesc"].ToString();
.
.
.

[/code]

 

This is an inefficient use of time and caffeine.  Since I do this all the time, I decided to write a class that does this in a more efficient way.  When you create the page design you have to name the controls the exact same name (case sensitive) as the column in your DataTable.  We loop through the DataTable and do a FindControl to then populate the data.  This worked fine until I created a page with a MasterPage - ugh!  FindControl isn't recursive so I hunted online and found a recursive FindControl and included it in my class.  Now it works on all pages.  I have cut my time (not caffeine intake) down considerably.  Now I can use that found time to blog :)

 

Here's the class (webhelper.cs):

[code:c#]

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Form functions
/// </summary>
public class webhelper
{
    /// <summary>
    /// Finds a control recursively.  Works in a page that has a masterpage, otherwise FindControl will return a null.
    /// </summary>
    /// <param name="root">Parent to search for - use "this"</param>
    /// <param name="id">Name of control you are searching for</param>
    /// <returns>Control - control you are searching for or a null if it's not found</returns>
    public static Control FindControlRecursive(Control root, string id)
    {
        if (root.ID == id)
        {
            return root;
        }

        foreach (Control c in root.Controls)
        {
            Control t = FindControlRecursive(c, id);
            if (t != null)
            {
                return t;
            }
        }

        return null;
    }

    /// <summary>
    /// Will pre-populate textbox and labels on a page with information from the first row of the DataTable. 
    /// Common use would be an account information page where you only have one row returned.
    /// TextBox and Label ID's must match the column name in the DataTable.
    /// </summary>
    /// <param name="root">Send "this" as the page root.</param>
    /// <param name="dt">DataTable with a single row.  If there are multiple rows it will only prepopulate the form with the first row.</param>
    public static void populateForm(Control root, DataTable dt)
    {
        for (int i = 0; i < dt.Columns.Count; i++)
        {
            Control c = FindControlRecursive(root, dt.Columns[i].ToString());
            if (c != null)
            {
                if (c.GetType() == typeof(TextBox))
                {
                    TextBox myBox = (TextBox)c;
                    myBox.Text = dt.Rows[0][i].ToString();
                }
                else if (c.GetType() == typeof(Label))
                {
                    Label myLabel = (Label)c;
                    myLabel.Text = dt.Rows[0][i].ToString();
                }
            }
        }


    }
}
[/code]

 

And here is how you use it on a page (dt has been defined as a DataTable and is populated with account information):

[code:c#]

webhelper.populateForm(this, dt);

[/code]

 

Wow, what an improvement in typing, huh?  In a future blog I'll show you how to do the same thing for saving the page.

You can download the class here.

 


Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Code Monkey | .net
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Sending email through GMail (or Google apps) with C#

May 29, 2009 05:18 by bjones

I have a couple of websites I've built that use GoDaddy hosting.  Instead of paying GoDaddy for their email service for my domains, I use Google Apps. It's free, they keep increasing the amount of storage (7GBs as of this blog) and I like the search feature.  In addition, I don't want to have my emails bounce as SPAM because I'm relaying it off GoDaddy's open relay so I'm bouncing it off of smtp.google.com.  Don't forget to add an SPF record (maybe I'll make that part 2 of this article).

I've been using System.Net.Mail to bounce email off a local SMTP host but had to go back to System.Web.Mail in order to authenticate for Google (my tin foil hat personality would suggest that Microsoft deprecated System.Web.Mail and left out authentication on System.Net.Mail to stop us from using Gmail). 

Below is a function I use to send email through GMail in my C# web apps.  The original code was written by Alex Sanchez for bouncing it off your local (or remote) mail server without authentication; I bastardized it to add authentication.


I have a typo in the Param section for the inFrom.  I couldn't figure out how to excape a < or > so I had to leave them out.  Make sure you use this format for your inFrom: "Name To Display" <email@domain.com>.  

Here you go: 

[code:c#]

/// <summary>
/// Sends email using Gmail or Email for Google apps.
/// </summary>
/// <param name="inFrom">From email addresses - format is: "Name To Display" email@domain.com </param>
/// <param name="inTo">To email addresses</param>
/// <param name="inSubject">Subject line</param>
/// <param name="inBody">Body of email in html markup or plain text</param>
/// <param name="inAttachmentPaths">String array of attachment paths on webserver</param>
/// <param name="isHTMLFormat">1 = HTML Format, 2 = plain text</param>
/// <param name="gmailAccountName">Account name for Gmail.  If you are using Email for Google Apps, you need to supply full email: email@domain.com</param>
/// <param name="gmailPassword">Password for your gmail account</param>
public static void SendEmailViaGmail(string inFrom, string inTo, string inSubject, string inBody, string[] inAttachmentPaths, Boolean isHTMLFormat, string gmailAccountName, string gmailPassword)
{
    System.Web.Mail.MailMessage myMailMessage = null;
   
    // Build email message
    myMailMessage = new System.Web.Mail.MailMessage();
    myMailMessage.From = inFrom;  // Format is: "Name To Display" <email@domain.com>
    myMailMessage.To = inTo;
    myMailMessage.Subject = inSubject;
    myMailMessage.Body = inBody; 
   
    if (isHTMLFormat)  // I send in plain text for SMS messages, HTML for the rest of the world
    {
        myMailMessage.BodyFormat = MailFormat.Html;
    }
    else
    {
        myMailMessage.BodyFormat = MailFormat.Text;
    }
   
   
    // Add attachments
    if (inAttachmentPaths != null)
        for (int i = 0; i < inAttachmentPaths.Length; i++)
            myMailMessage.Attachments.Add(new Attachment(inAttachmentPaths[i]));
   
   
    //  Authenticate
    myMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1);
    // Username for gmail - email@domain.com for email for Google Apps
    myMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", gmailAccountName);
    // Password for gmail account
    myMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", gmailPassword);
    // Google says to use 465 or 587.  I don't get an answer on 587 and 465 works - YMMV
    myMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
    // STARTTLS
    myMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", true);
   
   
   
   
    // assign outgoing gmail server
    SmtpMail.SmtpServer = "smtp.gmail.com";
    SmtpMail.Send(myMailMessage);
}

[/code]


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Code Monkey | SysAdmin | .net
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Fizzbin

May 1, 2009 10:56 by bjones
This post is only for geeks - you know the guys that live to sit in front of two (or three or better yet, four!) monitors pouring over a stack trace to find out why "is null" and "= null" aren't the same. Or for you sysadmins spending 2 days checking 5,000 cable drops to find out who created a loopback with the $5 linksys hub that brought down your entire network. If you fit one of these categories then fizzbin to you!

Imagine this scenario: You spent the last 16 straight hours working on a 52 node Beowulf cluster and you decide to go home while the final node is coming up. "I'll check it at home," you think to yourself. You get home, down a bottle of bawls and fire up your Macbook to find out that your internet connection is down. You get an IP, ping to your router but nothing further. Dang it, sun spots are wreaking habit again so you pick up the phone and call your ISP. Level 1 support gets on and starts asking you if you turned on your computer and is there a light on your modem? There is no need to talk to level 1 but they won't transfer you until you pretend to disconnect your wireless router and plug your computer (that you lied and said was XP so they would help) directly in to the cable modem. Reboot, wait, unplug cables, wait, unplug modems, wait, etc...

It's time to put an end to this frustration. Yes, my Mom needs to go through each step but, we geeks don't. Scott Hanselman has come up with an ingenious way for us to wink at the support tech on the other end of the phone and get us on to some real troubleshooting on their end. Fizzbin! It's a secret codeword that we can use to get past the mundane troubleshooting. It's so simple to use, just say "fizzbin" and the level 1 techie will know that you've already done everything she is going to asking you. And everything her level 2 techie is going to ask you so you both stop wasting each other's time. It will only work if we all know it, so pass it on!

Fizzbin to you!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: SysAdmin
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Stop the racism surrounding the H1N1 virus (swine flu)

May 1, 2009 08:07 by bjones
Michael Savage, a talk show host, said to avoid "contact anywhere with an illegal alien... and that starts with restaurants... don't know if they wipe their behinds with their hands!" Wait, seriously? I guess I have it all wrong, only illegal aliens don’t wash their hands. And only illegal aliens can spread the disease.

Frankly, I'm appalled with the racism surrounding the H1N1 virus! I think people are scared of the virus and they are too emotionally stunted to express themselves so the only thing they can do is conjure up hatred. People are using this outbreak as a way to promote their racist agenda. I mean, who is going to complain about a racist comment here or there about the supposed dirty people that gave us this flu?

Hispanic people are not dirty, they are not sub-Human and they are not all illegal aliens. Let people know this kind of racism disguised as stupidity is unacceptable (here is a list of stations that stream Michaels Savage's radio show).

When need to work together to get past the H1N1 virus, not against each other.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: op ed
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed