« MYOC - Update Twitter Status | Main | Win 7 - Manage Default Printers »

MYOC - E-mail Invite Notification

In this blog we’ll see how e-mail notifications can be sent to the participants to cast their vote for a poll using Microsoft live.

1. To send e-mails to the participants with the poll details, MYOC sends it through live server. It requires a valid live id to send e-mails. Below are the configuration settings used -

<Setting name="SmtpServer" value="smtp.live.com" />

<Setting name="SmtpUsername" value="myLiveId@live.com" />

<Setting name="SmtpPassword" value="****" />

<Setting name="SmtpPort" value="25" />

<Setting name="FromAddress" value="myUserId@myDomain.com" />

2. Create the message to be sent, get the e-mail IDs of the participants and write the code below to send e-mails from a specified address.

string messageToSend = "Hi, Please participate in this poll";

string emailIds = "Hi, Please participate in this poll";

 

(new SmtpClient(RoleManager.GetConfigurationSetting("SmtpServer"), int.Parse(RoleManager.GetConfigurationSetting("SmtpPort")))

{

      Credentials = new System.Net.NetworkCredential(RoleManager.GetConfigurationSetting("SmtpUsername"), RoleManager.GetConfigurationSetting("SmtpPassword")), 

EnableSsl = true

}).Send(RoleManager.GetConfigurationSetting("FromAddress"), emailIds, "MYOC Notification: You have been invited", messageToSend);

In this way e-mail notifications can be sent to participants.

TrackBack

TrackBack URL for this entry:
http://www.infosysblogs.com/apps/mt-tb.cgi/2026

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter