Hi Friends,
You will get SMTP configuration detail from central admin which is useful in webpart or workflow for email trigger.
using Microsoft.SharePoint.Administration;
You will get SMTP configuration detail from central admin which is useful in webpart or workflow for email trigger.
using Microsoft.SharePoint.Administration;
string smtpServer = SPAdministrationWebApplication.Local.OutboundMailServiceInstance.Server.Address;
string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;
string smtpFrom = SPAdministrationWebApplication.Local.OutboundMailSenderAddress;