Pages

Saturday, November 27, 2010

How to get a free domain name

1. Microsoft, of all people, will give you a website and domain name absolutely free. Though aimed at small businesses, anyone can register and set up a website.

Read more: How to get a Free Website and Domain Name | eHow.com http://www.ehow.com/how_2254591_website-domain-name.html#ixzz16dVPQsFt

2. Head to office.live.com and click on the button that says: "Office Live Small Business -- Sign Up for Free."

3. Fill in the simple registration information...it's basically name, city/state/zip, and email.

You'll be asked some business questions like "Number of employees". Just answer as best you can, even if the answer is zero, or one (yourself!).

4. Use the simple form that pops up to register a domain name, and build a website. You can have the whole thing in operation in 15 minutes.

Friday, October 8, 2010

Removing HTML tags from a string in C#

This following code can be useful to remove html tags from a string using C# language...


Code:

private string StripHTML(string strContent)
{
//strContent = Regex.Replace(strContent, @"[^\u0000-\u007F-\u0x0B]", "");
string asAscii = Encoding.ASCII.GetString(
Encoding.Convert(
Encoding.UTF8,
Encoding.GetEncoding(
Encoding.ASCII.EncodingName,
new EncoderReplacementFallback(string.Empty),
new DecoderExceptionFallback()
),
Encoding.UTF8.GetBytes(strContent)
)
);
return Regex.Replace(asAscii, "<.*?>", string.Empty);
}

Tuesday, September 28, 2010

How to send an email

How to send mail from Gmail without login your Gmail account
In this article I am going to discuss how to send mail from Gmail using Asp.net 3.5 without login your Gmail account.
Write the small line of code as follows:
Sample:
html body> form id="form1" runat="server"> fieldset style="width: 500px; padding: 10px;"> <legend>Sending email from GMaillegend> <div align="left" style="padding: 5px;"> Your Gmail EmailID<br /> <asp:TextBox ID="TextBoxSenderEmailId" runat="server"Width="250px">asp:TextBox><font color=silver>Please enter your GMailId <br />(e.g yourId@gmail.com)font><br /><br /> Friend's EmailId<br /> <asp:TextBox ID="TextBoxReceiverEmailId" runat="server"Width="250px">asp:TextBox><font color=silver>Please enter your friend's emailId<br/>(e.g abc@xyz.com)font><br /> <br /> Subject<br /> <asp:TextBox ID="TextBoxSubject" runat="server"Width="350px">asp:TextBox><br /> <br /> Body<br /> <asp:TextBox ID="TextBoxBody" Width="350px" TextMode="MultiLine" Rows="5"runat="server">asp:TextBox><br /><br /> <asp:Button ID="btnSendEmail" runat="server" OnClick="btnSendEmail_Click"Text="Send" />

</div> </fieldset> </form> </body> </html>


using System;
using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class SendingMailByGMail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { }
protected void btnSendEmail_Click(object sender, EventArgs e) { System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage(TextBoxSenderEmailId.Text, TextBoxReceiverEmailId.Text, TextBoxSubject.Text, ""); MyMailMessage.IsBodyHtml = false; MyMailMessage.Body = TextBoxBody.Text; //provide Authentication Details need to be passed when sending email from gmail System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential(TextBoxSenderEmailId.Text,"password");//Sender password
//Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587 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);
}
}