Welcome to CrankyGoblin.Com Sign in | Join | Help

Public Class GeoffAppleby

Inherits Microsoft.VisualBasic.MVP : Implements IBrainFart
Sending Emails Has Become Easier

About 6 months ago at work we needed to write a service that could send automated emails - specifically ones that had documents attached to them. I was extremely disappointed at the time (and still am) that the stuff provided to us in the framework (System.Web.Mail) could only handle attachments that were located somewhere on the filesystem. This is horribly limited, especially since the stuff we wanted to attach was reports that were generated on the fly and only existed in memory.

We got around it, but I never liked the solution.

I just discovered that in the 2.0 framework, there's a new namespace: System.Net.Mail. These new classes do support better attachments - from file, a string, or a stream.

Much better! Yet another thing to to add my list of upgrades when November hits :)

Posted: Sunday, August 07, 2005 11:53 PM by Geoff Appleby
Filed under: ,

Comments

Adam Saxton said:

Great find!
# August 8, 2005 2:50 PM

Jeff Lynch said:

The beta 1 version of BizTalk 2006 uses these new classes in the SMTP Send Adapter also. Much improved attachment handling.
# August 8, 2005 5:54 PM

jayson knight said:

Finally! System.Web.Mail was such a hack around cdonts. Looking forward to tinkering w/ the new namespace.
# August 8, 2005 6:24 PM

Eric Newton said:

The System.Net.Mail namespace has some well designed classes in it...

I just wish that the System namespaces become more useful for building Frameworks based on it.

For instance, it would be cool if System.Net.Mail had an interface IMailMessage which 3rd party mail providers could implement and make choosing a new 3rd party mail component a breeze! Just like ADO.Net, Mail.Net should have these more generic interfaces.
# August 9, 2005 5:25 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

To submit your comment, click on these pictures:
  • Geoff's foot
  • Teenage Mutant Ninja Geoffy!
  • Geoff's tongue
Gaptcha Image - No Peeking! Gaptcha Image - No Peeking! Gaptcha Image - No Peeking!
Gaptcha Image - No Peeking! Gaptcha Image - No Peeking! Gaptcha Image - No Peeking!
Gaptcha Image - No Peeking! Gaptcha Image - No Peeking! Gaptcha Image - No Peeking!
Can't recognise the people in these pictures? Look here for a quick introduction.
There's a time limit for you to get your comment submitted before this set of pictures expires. If you think it's been longer than 10 minutes, get some new pictures first (you won't lose what you've typed so far).
Get some new pictures 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS