Programmatically Using the Outgoing SMTP Server from Central Admin

Had a need today to programmatically get the outgoing SMTP server that is setup in the Central Administrator. Luckily, I found a sample of how to do this with WSS V3 from the folks at Covelle Corner. Worked like a champ for me! They use the following code (obvious credit to Covelle Corner for this): /// /// Returns SharePoint smtp server /// /// private string GetSmtpServer() { SPWebApplicationCollection spWebApplicationCollection = SPWebService.ContentService.WebApplications; SPOutboundMailServiceInstance smtpServer = new SPOutboundMailServiceInstance(); if (spWebApplicationCollection != null) { foreach (SPWebApplication spWebApplication in spWebApplicationCollection) { smtpServer = spWebApplication.OutboundMailServiceInstance; return smtpServer.Server.Address; } } return string.Empty; }

U2U CAML Query Builder

The Mossman got to spend some time with John Holliday “SharePoint Ninja” today. He demoed the CAML Query Builder from U2U and I have to say I was quite impressed by it. Not sure why Microsoft wouldn’t include something like this with SharePoint, but it really does make the tedious job of working with CAML a lot nicer. He showed off its capabilities to connect to an existing SharePoint site, browse the available objects, view the available fields, piece together a query, preview the results, and copy and paste the resultant CAML query. Pure hotness, check it out. U2U CAML Query Builder

How to Add a Button to the HTML Editor Control in SharePoint 2

The HTML Editor Control (or rich text editor) in SharePoint 2007 is a pretty helpful addition to the product (assuming your users are using IE). If you would like to programmatically add your own buttons to the toolbar, you will most likely find only one or two articles from a Google search on the topic. Most links point to this page at the msdn: How to: Add a Button to the HTML Editor Field Control Unfortunately, I think this document is flawed in many ways. Because of this, the other day, I set out to actually get it working, and in the process I have simplified their example and have made it a bit more useful (hopefully). I’m not sure why their example is filled with syntax errors, contains unnecessary logic (example: always reading the second item in an array?!?!), and does not bother to reset the button to a usable state when they are ...