문제

I would like to get the paramaters shown in the following picture. can this been done and how?

Thank you

P.S. I wonder if it's possible to send email using scom and Sharepoint email system.

screenshot

도움이 되었습니까?

해결책

You can use below code for that

using(SPSite site = new SPSite(siteUrl))
{
    string smtpHost = site.WebApplication.OutboundMailServiceInstance.Parent.Name
    string fromEmail = site.WebApplication.OutboundMailSenderAddress
}

Or

var admin = new Microsoft.SharePoint.Administration.SPGlobalAdmin()
var server = admin.OutboundSmtpServer
var replyToAddress = admin.MailReplyToAddress
var fromAddress = admin.MailFromAddress
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top