Send Email On Sharepoint Web Part Programmatically

public static bool SendMail(string Subject, string Body, bool IsBodyHtml, string From, string To, string Cc, string Bcc)
		bool mailSent = false;
			SmtpClient smtpClient = new SmtpClient();
			smtpClient.Host = "";
			smtpClient.Port = 25;
			MailMessage mailMessage = new MailMessage(From, To, Subject, Body);
			if (!String.IsNullOrEmpty(Cc))
				MailAddress CCAddress = new MailAddress(Cc);
			if (!String.IsNullOrEmpty(Bcc))
				MailAddress BCCAddress = new MailAddress(Bcc);
			mailMessage.IsBodyHtml = IsBodyHtml;
			mailSent = true;
		catch (Exception) { return mailSent; }
		return mailSent;

sumber: Learning Sharepoint


About windupurnomo

I'm interested in programming. I am active with several programming such as Java, C #, C, JavaScript, HTML. I'm also develop desktop application (Java Swing), Mobile Application (Android), and Web programming (ASP MVC).
This entry was posted in Microsoft, Sharepoint and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s