Scenario:
I wanted to send some emails from my custom code and thought of using the smtp information entered into Central Administration Web Application. So before even trying to send email , I wanted to check if the information is available or not.
Solution:
SPUtility class is very powerful class and provide whole bunch of helpful functions.
Code:
Article:
if (SPUtility.IsEmailServerSet(web)){
SPUtility.SendEmail(web,False,False,"name@email.com","Thanks", "howz life ?");
}
MSDN
0 comments:
Post a Comment