Google Buzz Posting from Asp.net Web Application

Step 1: As Google Buzz require a valid gmail account. You need to decide, from which gmail account you would like to post google buzz. For this example, i would be posting google buzz from my gmail account.

Step 2: Enable Google Buzz posting by sending email. Please follow following to do so.
a) Log into your gmail account.

b) Open Google Buzz.

c) Click on Connected Sites link as shown in figure.


d) Click on Add button associated with "Post via buzz@gmail"


e) Click on save button.

Step 3: Open Visual Studio and create new asp.net website.

Step 4: Arrange web control as shown in following figure.



Step 5: Call following Function from Button Click Event.

private void PostBuzzMsg(string strEmail, string strPassword, string BuzzMsg)
{
//Create Mail Message Object with content that you want to send with mail.
System.Net.Mail.MailMessage MyMailMessage =
  new System.Net.Mail.MailMessage(strEmail, "[email protected]",
  BuzzMsg + "... http://lesson8.blogspot.com", string.Empty);

MyMailMessage.IsBodyHtml = false;

//Proper Authentication Details need to be passed when sending email from gmail
System.Net.NetworkCredential mailAuthentication = new
System.Net.NetworkCredential(strEmail, strPassword);

//Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587
//For different server like yahoo this details changes and you can
//get it from respective server.
System.Net.Mail.SmtpClient mailClient =
  new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);

//Enable SSL
mailClient.EnableSsl = true;

mailClient.UseDefaultCredentials = false;

mailClient.Credentials = mailAuthentication;

mailClient.Send(MyMailMessage);
}


Step 6: Run asp.net website and Send Message.

Google Buzz Posting from Asp.net Web Application Google Buzz Posting from Asp.net Web Application Reviewed by vishal on 5:17 AM Rating: 5