SMTP Component for .NET Recommendation

I’ve been relying on the MailBee.NET SMTP Component from AfterLogic for several months now and just wanted to recommend it to anyone needing a SMTP component for your .NET development. It’s inexpensive and easy to use:

Pop3 pop = new Pop3();
try
{
    pop.Connect(emailPop3Server, 110);
    if (_quitting) { return; }

    pop.Login(emailAccountName, emailPassword, AuthenticationMethods.Auto);
    if (_quitting) { return; }

    MailMessageCollection msgs = pop.DownloadEntireMessages();
    foreach (MailMessage m in msgs)
    {
        try
        {
            if (m.HasAttachments)
            {
                foreach (Attachment attach in m.Attachments)
                {
                    if (attach.ContentType == "image/jpeg")
                    {
                        using (MemoryStream memStream = new MemoryStream(attach.GetData()))
                        {
                            Image img = Image.FromStream(memStream);

                            if (_quitting) { return; }

                            using (MemoryStream compressedJPG = BuildJPGWithCompressionSetting(img, 60))
                            {
                                // the filename doesn't need to be meaningful, and would be better if it weren't to prevent conflicts!
                                string newFileName = string.Format("{0}.jpg", Guid.NewGuid());
                                Upload(compressedJPG, ftpSite + newFileName, ftpAccountName, ftpPassword);
                            }
                        }
                    }
                    if (attach.ContentType == "multipart/related")
                    {
                        //MimePart mp = attach.AsMimePart;
                        //MimePartCollection mpc = mp.GetAllParts();
                    }
                } // thru each attachment
            } // has attachement?
        }
        finally
        {
            m.Dispose();
        }
    }   // loop thru all the messages
}
finally
{
    if (pop != null)
    {
        pop.DeleteMessages();
        pop.Disconnect();
        pop = null;
    }
}

The above code is used in a Windows Service I’ve written to automatically connect to a specific e-mail address, download the messages, and automatically upload the attached images to an FTP Server (I’ve removed some of the security checks that my code does).

You can see though in the code how easy it is to use the component. It takes the pain out of doing SMTP development and handles a wide variety of cases that might exist (there are multiple techniques for attaching images for example).

I purchased the Single Developer License at $69 — which is a license for unlimited use of the component by me.

They also have a set of components for IMAP, POP3 and security available individually or as a package deal (although it wasn’t clear the package was necessarily as good a price).

AfterLogic has a 30 day trial available for all of their components.

Recommended.

Spam makes me laugh some days

Some spam makes it by the various spam filters I have in place. Occasionally, one grabs my attention as obvious spam, but still I open and scan it. Here’s one that I found funny:

image

Hi to you USA Embassy! I’m not sure why the USA Embassy is in the USA, but hey, it’s so nice of them to write me!

I’m glad I’m the owner of the e-mail address, otherwise the USA Embassy might be ticked-off that I’m reading their message.

image

My consignment box is in their custody? Well, how the heck did that happen? I better comply quickly so that the delivery will be effected immediately!

FedEx Express is to deliver it? Great! I love love that company company.

image

$195 to get my consignment box back and so they can effect the delivery to my home address! Sweet! What a bargain!

image

I guess I wasn’t fast enough — as the price has already increased to $295! That’s highway robbery — just to get my consignment box back!

I see that there’s a text question and answer available. Feel free to use that if you need to today.

But, this is the real annoying part — they forgot to include the MTCN Number I need for easy pick-up!

image

It was so nice of Donald to write me as the public relation officer of the United State Embassy. Donny (may I call you that?), what happened to the other states? Can you unite when there’s only one?

We now return to our regularly scheduled blog posts.

SMTP on Windows with WordPress

My blog is hosted on a shared Windows web server running IIS. My web host does not support WordPress’ ability to send e-mails as notifications without a modification. This problem occurs in WordPress 2.3, and WordPress 2.5, but may occur in other versions.

Thankfully, there’s a simple fix without requiring any modification of source code.

To enable e-mail notifications, I downloaded this plug-in:

WP-Mail-SMTP (download here)

Once you’ve enabled the Plug-in, you’ll find the Email settings here:

image

then

image

Then, provide the needed information and click the Update Options button. Use the Test Email form to make sure everything works.

Moved to WordPress

After a frustrating experience with The BlogEngine.NET and no desire whatsoever to troubleshoot the problem beyond a few simple tests, I’ve switched my blog to using WordPress. I generally liked BlogEngine, but for some unknown reason, my current feed reader (Google Reader), kept reporting that old blog posts had changed when in fact they really had not. I know it wasn’t just me either having this problem, so I hope that this annoying issue does not repeat itself with WordPress.

I’ve got a few easy ways to subscribe to the new feed:

technorati add aol netvibes myyahoo modern freedictionary ngsub

Sorry about the inconvenience.

Now that I believe this problem is fixed, I’m going to start posting again more frequently. I avoided posting knowing that my feed was having issues.