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 ...

Sharepoint 2007 Customization Ramp Up – Part 3: Basic Customization 1

Welcome to Part 3 of the series. In the previous two sections I covered things you should know before getting started with SharePoint Customization, while in this section I will cover actually doing some customization. Firstly, let me state for the record that most of what I’ve learned on this topic has been from reading blogs from Heather Solomon and Liam Cleary, along with just playing with things myself. Many of the topics covered in this article can seen in much more detail in some of their posts. Basic Customization: Using SharePoint Designer Understanding How Pages are Rendered in SharePoint Minimal Master Page Overriding Cascading Style Sheets CSS Friendly Adapters Customizing Navigation Customizing Search Results More Customization Examples   Using SharePoint Designer I covered some basic concepts of using SharePoint Designer and the pitfalls of UnGhosting in my previous article. That being said, this article will be centered mostly around customization by using SharePoint Designer, ...

CSS Friendly Control Adapters in SharePoint 2007 (A Walk-Through) 2

My good friend John Ross just managed to get the CSS Friendly Control Adapters working in a SharePoint 2007 Publish Site, and I was able to talk him into posting a guest blog entry on the topic. If you aren’t familiar with them, you should check out the CSS Friendly Control Adapters here, they are very helpful in creating CSS only, standards compliant controls (like the menu and treeView) for easy styling. I also noted that Microsoft was kind enough to allow the community to take over the development and enhancements of the adapters in an open source model. You can read more about that news in their forums. So without further fanfare, here is John Ross’s CSS Friendly Adapters in SharePoint 2007 walk-through: One of biggest selling points for SharePoint 2007 is that it is built on top of ASP.NET 2.0.  That means, that if you create a design that will work in ASP.NET ...

Sharepoint 2007 Customization Ramp Up – Part 2: Initial Concepts

In Part 2 of this series I wanted to cover some of the initial concepts involved in customizing SharePoint 2007. I will try to cover a few of the highest level ideas that you need to understand through some descriptions and links to some of the blog posts that cover the concepts in more detail. Initial Concepts: Wss vs. Moss 2003 vs. 2007 Publishing Site vs. Team Site Site Collections vs. Sites Using SharePoint Designer Ghosting and UnGhosting The 12 Hive   Wss vs. Moss An obvious first place to start, is the differences between Windows SharePoint Service Version 3 (WSS V3) and Microsoft Office SharePoint Server 2007 (Moss 2007). I’m not sure what team at Microsoft is involved with coming up with the official names of their products, but I’m quite certain they need to be disbanded and reinvented. No marketing company in their right mind would name these products so similarly. To put ...

Sharepoint 2007 Customization Ramp Up – Part 1: Getting Started

Welcome to Part 1 of a multipart series on getting ramped up on SharePoint 2007 customization. My team is working on a good sized Moss 2007 implementation currently and have begun the customization process, in this series I will try to recount the basic steps we have used to get to where we are in the project. This series will consist mostly of links to the many blog and web postings that our team found useful throughout the learning process. I will also try to describe some key points that I think are necessary to “get” Moss 2007 customization. So, without further fanfare, here is part 1. SharePoint 2007 Customization Ramp Up – Part 1: Getting Started For this part, I will only be discussion the very basics of getting started. When my team began the project we had no knowledge of SharePoint 2003 or ECM for that matter. We started by just reading as ...

404 Error for Anonymous Users in Publishing Site

Here’s a quick gotcha that I just remembered. If you are customizing a Publishing Site and you have just created a new masterpage, you may run into a situation where anonymous users are getting a 404 error trying to view the website. This may be obvious to some people but it took me a good couple hours to figure out that in a Publishing Site, approvals are turned on by default. The user you created the masterpage with will be able to see it but until you publish and approve it, no anonymous user will be able to see the masterpage (since it would be a violation of the approval process). I’m thinking Microsoft could have come up with a better error message in this scenario, but I guess 404 makes sense because to that user the page really doesn’t exist yet.