How Many Developers Does It Take to Send Spam?

Apparently, several. I am the 2008 director for Boise Code Camp and I found myself needing to send email to 400 people from our mailing list to tell them about the upcoming Code Camp.

I sent an inquiry to our Code camp online group asking the simple question, “How would you send 400 emails?” The list of answers was hilariously geeky and shows the nature of my friends.

Option 1 – Write Code

You could rip through a CSV and Send via code through Google.

   1: MailMessage email = new MailMessage();
   2: email.From = new MailAddress( "support@foo.com",    "FOO Support");
   3: email.Subject = "Welcome to list";
   4: email.Body = "The Message";
   5: email.To.Add(TextBox1.Text);
   6: SmtpClient server = new SmtpClient("smtp.gmail.com", 587);
   7: server.Credentials = new     NetworkCredential("support@foo.com",     "ThePassword");
   8: server.EnableSsl = true;
   9: server.Send(email); 

Option 2 – Write Code

Send it with a local SMTP client.

   1: using System.Net.Mail;
   2: using System.Text;
   3:  
   4:        //'ute' is my utility object and it has a property 'AdminEmailAccountName':
   5:         MailMessage msg = new MailMessage(ute.AdminEmailAccountName, toUser.Email);
   6:         msg.IsBodyHtml = true;
   7:         msg.Subject = "Message from Code Camp";
   8:        //Use my template with the verbiage for the message
   9:         StringBuilder sb = new StringBuilder(Resources.ContactUser.EmailTemplate);
  10:  
  11:        //Replace the placeholders with actual values:
  12:         sb.Replace("recipientPlaceHolder", toUser.DisplayName);
  13:         sb.Replace("senderPlaceHolder", fromUser.DisplayName);
  14:         sb.Replace("subjectPlaceHolder", ute.CleanCusswords(txtSubject.Text));
  15:         sb.Replace("bodyPlaceHolder", ute.CleanCusswords(txtMessage.Text));
  16:         sb.Replace("UserIDPlaceHolder", fromUser.UserID.ToString());
  17:         msg.Body = sb.ToString();
  18:  
  19:         SmtpClient client = new SmtpClient(ute.SmtpHostName);
  20:         client.Send(msg);

Option 3 – MS Word Mail Merge Feature

What is Mail Merge you ask? It’s one of those 9000 features in MS Word you never heard of and never would have considered finding in a text editor. To be fair, after playing with this feature, it is very cool and is how I will send the email next time.

Check it out, it’s in help. I know, I know, but that’s what I had to do.

Option 4 – Brute Force

Copy and paste 400 comma delimited email addresses into the TO: field of Google mail and hit “send”. When the warning pops up telling you this is taking a long time, just say “I know” and tell it to keep spinning.

I can tell you from experience that this works just fine 🙂

Conclusion

I feel like a doof for passing up an opportunity to write code. On the other hand, I had time to blog about this because I didn’t bother writing code.

Go figure.

3 thoughts on “How Many Developers Does It Take to Send Spam?

  1. But…if it’s a mailing list, wouldn’t you just send a message to the broadcast address for the mailing list?

    Maybe I’m confused here.

  2. Well, good lord my man, in that case, and i can’t believe i’m going to say this to a brilliant elegant coder..”K.I.S.S.” (ie. keep it simple stupid) . So, you have 400 emails in excel, save the file as a coma seperated value(csv) in .txt fomat, then import that into outlook, then create a distribution list.

    With the distribution list or even having all those emails now in contact there are several options available to you.

    1.Use Outlook and create an email and send to the distriubtion list.
    2.Use office publisher 2007 and create a fantastic looking email and then use the email merge funtion.

    Or, for those that just need to create code, code something that would read in the text file and mass mail everyone.

Comments are closed.