Tag Archives: email

Sorry if I look dumb, this was sent from my phone

I’m sure this isn’t anything new, but it’s something I’ve noticed several times in the past few weeks: email signatures that say, “This email was sent from my phone, please excuse typos and brevity.” I already find it borderline offensive when somebody sends me a sloppy email with misspelled or abbreviated words and broken sentences, but to then suggest that I overlook these “mistakes” is enough to set me off.

Yes, it’s harder to type quickly and accurately from your smartphone. There’s nothing that prevents you from reading what you wrote to determine whether or not you sound like a moron, though. Nobody’s reading your horrible email and then getting to the signature and saying, “Ohhhhh, it’s just because they sent it from their phone. Whew! I was beginning to think they were dumb or didn’t care about the quality of what they produce, but it’s actually because they’re being ultra-responsive to my needs by replying on the go.” What people are really going to think is that you don’t know better or don’t care about your mistakes, and I’m not sure which is actually worse.

So, instead of letting the world know that you probably know better–and I assure you, the world doesn’t think you do–but you just don’t care, how about you take the time to READ what you’re sending and correct mistakes that you notice? Yes, you’ll probably make a typo here and there or misuse/forget to use a comma, but that’s bound to happen regardless of how you’re communicating. It’s okay, and it’s better than acknowledging that you probably sound like an idiot but just don’t care.

At the end of the day, people who care about spelling, grammar, and professionalism are going to judge you regardless of what your email signature suggests. What you should really do is just slow down and review what you produce. If you find that you just can’t write a high-quality email from your phone, I suggest you stop trying and reserve yourself to only sending emails from a computer. If it’s something that really, truly can’t wait, email is probably not the most effective means of communication, anyway. (Hint: It is incredibly likely that your phone has a phone feature.)

Advertisements

Create Permanent Custom Styles in Outlook

One of my peeves in Outlook is the formatting of code snippets that I send in email. Nine times out of ten, I’m copying and pasting from Visual Studio. That works pretty well; you get keyword highlights and all that fun stuff. Life is good–unless you happen to have a dark background. I like the dark theme for Visual Studio 2012, but I can’t stand that pasted text comes with a black highlight! It’s not that I mind the black background, but the highlighted text looks like a disaster.

DarkBackgroundCodePasteIntoOutlook

At this point, you’ve got three options: go back to a light-background theme in Visual Studio, deal with it, or adjust the formatting in Outlook. It looks too ugly for me to ignore, so option #2 is out. Until know, I’ve been exercising option #1, living in a default-themed world. I decided to go in a different direction today, though. I created a style that I can use to quickly format my pasted code. (An easy solution that I considered using for a while was to use LINQPad as a formatting buffer. I’d copy/paste code from Visual Studio to LINQPad and then re-copy/paste from LINQPad to Outlook. It works.)

The key to making this as painless as possible is getting the style configured correctly. Here are the steps I used to create my new style in Outlook 2013:

  • Choose “Create a Style” from the Styles gallery (FORMAT TEXT > Styles)
  • Change paragraph spacing options
    • After: 0 pt
    • Line Spacing: Single
  • Modify borders and shading
    • Border Setting: Box
    • Border Color: White
    • Border > Options > From text (all sides): 12 pt
    • Shading Fill: Custom Color (RGB: 30, 30, 30)

To ensure the style sticks around for future emails, do the following:

  1. Change Styles > Style Set > Save as a New Style Set…
  2. Change Styles > Style Set > Set as Default
  3. Restart Outlook for the new default style set to take effect

When I paste code from my dark themed Visual Studio, it still looks ugly. I can make it prettier by simply selecting the text and applying my new style. As a final beautification, I select the text and remove the black highlight from the text. (The removal of highlighting wouldn’t be necessary if I were content to use a black background, but I think 30/30/30 gray looks nicer, and so I will remove the highlight.)

DarkBackgroundCodePasteIntoOutlook_Better

It’s definitely a few extra clicks anytime I’m sending code, but the end product looks good!

Windows Workflow 4: Creating a Simple Custom Activity

The Windows Workflow Foundation project that I’m working on relies on my ability to create a library of custom activities that can be used together to handle many different customer scenarios. Creating a simple custom activity is a very easy and straightforward task with WF4. This post will walk you through the steps of creating a custom send-email activity.

The first thing you’ll need to do is create a new class that inherits from NativeActivity. (Note that NativeActivity is not your only option–check out this post for an overview of the different choices.) NativeActivity is an abstract class that requires us to implement an Execute method. This is the method that runs when the activity executes.

public sealed class EmailActivity : NativeActivity
{
    protected override void Execute(NativeActivityContext context)
    {
        throw new NotImplementedException();
    }
}

We’ll need some additional information in order to send an email, and we can use input arguments to get what we need. To add an input argument, create a public property of type InArgument<T>. Here are my input properties. Notice that I’ve decorated some of them with the [RequiredArgument] attribute to indicate that they are required. Output arguments can be added in a similar fashion by using OutArgument<T>, though we do not need any for this example.

[RequiredArgument]
public InArgument<string> Host { get; set; }

[RequiredArgument]
public InArgument<string> Sender { get; set; }

[RequiredArgument]
public InArgument<string> Recipients { get; set; }

public InArgument<string> Subject { get; set; }

public InArgument<string> Body { get; set; }

Now that we have all the information we need, we just need to implement the Execute method to send an email. Once again, it’s very simple.

protected override void Execute(NativeActivityContext context)
{
    // create the email message
    var mailMessage = new MailMessage();
    mailMessage.From = new MailAddress(Sender.Get(context));
    mailMessage.To.Add(new MailAddress(Recipients.Get(context)));
    mailMessage.Subject = Subject.Get(context);
    mailMessage.Body = Body.Get(context);

    // send the message
    var smtpClient = new SmtpClient(Host.Get(context));
    smtpClient.Send(mailMessage);
}

This activity can now be added to your workflow XAML through the designer or any text editor. In the example below, I have bound the Body property to a variable named StatusText that will be set in an earlier activity.

<my:EmailActivity
  Host="mail.mydomain.com"
  Sender="myworkflow@mydomain.com"
  Recipients="someuser@mydomain.com"
  Subject="Workflow Status Update"
  Body="[StatusText]" />

Here is the complete class:

public sealed class EmailActivity : NativeActivity
{
    [RequiredArgument]
    public InArgument<string> Host { get; set; }

    [RequiredArgument]
    public InArgument<string> Sender { get; set; }

    [RequiredArgument]
    public InArgument<string> Recipients { get; set; }

    public InArgument<string> Subject { get; set; }

    public InArgument<string> Body { get; set; }

    protected override void Execute(NativeActivityContext context)
    {
        // create the email message
        var mailMessage = new MailMessage();
        mailMessage.From = new MailAddress(Sender.Get(context));
        mailMessage.To.Add(new MailAddress(Recipients.Get(context)));
        mailMessage.Subject = Subject.Get(context);
        mailMessage.Body = Body.Get(context);

        // send the message
        var smtpClient = new SmtpClient(Host.Get(context));
        smtpClient.Send(mailMessage);
    }
}