Posts

Showing posts from April, 2013

How to get absolute URL of a web application (SPWebApplication) in SharePoint 2010 C#

Hi Here is the sample code to get absolute URL of web application; string path = webApp.GetResponseUri(SPUrlZone.Default).AbsoluteUri; Thanks

Solved! How to send email using C# in .Net , Simple Code

Hi, These settings are using google email. You may configure it accordingly. using System.Net; using System.Net.Mail; MailMessage mail = new MailMessage (); SmtpClient SmtpServer = new SmtpClient ( "smtp.google.com" ); mail.From = new MailAddress ( "from address" ); mail.To.Add( "to address" ); mail.Subject = "Email Subject" ; mail.Body = "Email Body" ; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net. NetworkCredential ( "from address" , "from address password" ); SmtpServer.EnableSsl = false ; SmtpServer.Send(mail);