Bulk Email

In this Beginners article we will see how simple it is to extract an email addresses from web page. 

for demo purpose We will extract all emails from

URL://  http://eggheadcafe.com/aboutus.aspx 

  Here we will use Email validation regular expression.

You can develop your own regular field validation expressions using Free Expresso tool 

Link to download expresso tool for to Learn regualr field expressions in 60min. 

 http://www.ultrapico.com/Expresso.htm

Here is this  line of code

protected void Button1_Click(object sender, EventArgs e)

{

// Create WebRequest

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(http://eggheadcafe.com/aboutus.aspx);

// Initialise the connection

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

// Start receving the Response and store it in to Stream and pass it to Stream reader

StreamReader reader = new StreamReader(response.GetResponseStream());

string responseText = reader.ReadToEnd();

// Here we will apply regualr expression to responseText

//string pattern is Email validation Expressioin

Regex re = new Regex(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");

MatchCollection me = re.Matches(responseText);

String str = string.Empty;

foreach(Match m in me)

{

str += m.Value + " , " ;

}

Response.Write(str);

}

Now, you can use this code to send bulk emails  

http://www.revenmerchantservices.com/page/Send-Email.aspx

Satalaj

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.