SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently working on sending an email with an iCal event that users can accept/decline to add it to their calendar. The built-in SPUtility.SendEmail is too limited to achieve this so I'm using SmtpClient instead. However, I've needed to hard code the Outbound SMTP Server shown in the image below because I've been unable to find this property from the SharePoint API:

Outbound SMTP Server

This is obviously going to cause problems when the Outbound SMTP server changes because I will have to remember to update it in 2 places. How can I access this property using the SharePoint API?

share|improve this question
up vote 3 down vote accepted

I found an article by Randy Drisgill that describes how to get the SMTP server by using the SPWebApplication.

The one-line code to get the property is SPContext.Current.Web.Site.WebApplication.OutboundMailServiceInstance.Server.Address.

share|improve this answer

Look at this article. Should help:

share|improve this answer
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Eric Alexander Aug 20 '13 at 20:53
While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines. Also we require disclosure of any affiliation with products or websites. Please see May I promote products or websites I am affiliated with here? for guidelines. – SPDoctor Aug 21 '13 at 9:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.