Showing posts with label Source Code. Show all posts
Showing posts with label Source Code. Show all posts

Thursday, December 18, 2014

C# CODE TO EXTRACT EMAIL FROM WEB TUTORIAL BUILD A POWERFUL BOT

(C# + VB) SEND EMAIL WITH ATTACHMENTS IN ASP.NET [ FULL SOURCE CODE] TUTORIAL WITH LIBRARIES INCLUDED ON TOPBOTS.BLOGSPOT.COM


Other Non Bot Options:
Can't Afford A Bot? Buy SEO & Social Media Metrics For Cheap Starting at $1 Dollar

 http://a.seoclerks.com/rss?


In this example i am going to describe how to send email with attachment in ASP.NET using fileUpload Control. I am saving the uploaded file into memory stream rather then saving it on server.And for this example i m using Gmail SMTP server to send mail, this code also works fine with any SMTP Server. For sending Email in ASP.NET , first of allwe need to add Syatem.Net.Mail namespace in code behind of aspx page.
C# Code Behindusing System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnSend_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To.Add(txtTo.Text);
//mail.To.Add("amit_jain_online@yahoo.com");
mail.From = new MailAddress(txtFrom.Text);
mail.Subject = txtSubject.Text;
mail.Body = txtMessage.Text;
mail.IsBodyHtml = true;

//Attach file using FileUpload Control and put the file in memory stream
if (FileUpload1.HasFile)
{
mail.Attachments.Add(new Attachment(FileUpload1.PostedFile.InputStream, FileUpload1.FileName));
}
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("YourGmailID@gmail.com", "YourGmailPassword");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);

}
}
VB.NET Code Behind

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Net.Mail

Public Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

End Sub
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim mail As New MailMessage()
mail.[To].Add(txtTo.Text)
'mail.To.Add("amit_jain_online@yahoo.com");
mail.From = New MailAddress(txtFrom.Text)
mail.Subject = txtSubject.Text
mail.Body = txtMessage.Text
mail.IsBodyHtml = True

'Attach file using FileUpload Control and put the file in memory stream
If FileUpload1.HasFile Then
mail.Attachments.Add(New Attachment(FileUpload1.PostedFile.InputStream, FileUpload1.FileName))
End If
Dim smtp As New SmtpClient()
smtp.Host = "smtp.gmail.com"
'Or Your SMTP Server Address
smtp.Credentials = New System.Net.NetworkCredential("YourGmailID@gmail.com", "YourGmailPassword")
'Or your Smtp Email ID and Password
smtp.EnableSsl = True

smtp.Send(mail)
End Sub
End Class

http://www.plndr.com/?r=9909916&utm_source=invite&utm_medium=referral&utm_campaign=personalurl http://addmf.co/?BGKB7CH http://addmf.cc/?BGKB7CH http://a.seoclerks.com/linkin/252867 http://www.reverbnation.com/c./a4/10232852/3928250/Artist/3928250/Artist/link http://proxypremium.blogspot.com/2014/01/free-daily-proxy-list-txt-download.html Jay%20Stilla







Likes For Free,
Unlimited Likes Bot,
Unlimited Follow Bot,
Email Scrapping Friend Adding Mail Sending Automated Bot,
We Build Bots,
SEO Bot,
Backlinking Bot,
VMware Virtual Social Friend Follow Connect Farming Bot,
Buy iTunes Store Reviews ,
Buy iTunes Store Auto Review Bot,
Buy amazon Store Auto Review Bot,
Buy Google Play Store Auto Review Bot,
Buy Yelp Store Auto Review Bot,
Add Friends,
Friend Adder,
Post Blaster Bot,
Twitter Bot,
Tweet Bot,
Insta Bot Bots,
Robo Bot - Multi Clicker - Automated Macro System,
Free Social Media God Bot,
Facebook God Bot,
Twitter God Bot,,
Wholesale Social Media Follows , LIkes, Post,
Facebook , Twitter , Google , 
Free Proxy Bot,
Free Ip Masking Bot,
Free Apple iTunes Review Bot,
Automated Review Bot,
Fake Reviews Bot,
Fake Reviewer,
Proxy Switcher,
Plays Increaser,
Views Increaser,
Automatic Review, Posting Program,
iTunes Bot,
Multi Task Macro Scirpt Auto Posting Article Bot,
Free Downloads, Master Key Gen Bot, Universal Key Maker Bot,

Free Download The Hunger Games MockingJay : Part 1 Studio Copy Dvd Blu Ray Full HD Movie 2:56.00 1080p Xvid, Dolby 5.1,7.1 Surround Sound Optimized Torrent Download, Full Studio Release, Leaked Copy, Private Screening Copy, Directors Cut, Extra Scenes, High Quality, Ultra Blu Ray Free Movie Download No Cost 100 Seeders 3 Leechers Jennifer Lawrence  Includes Half of The Hunger Games :Rise Of Fire Platinum Edition Part 2 Cam HD Blu Ray True Color 720 p, 1080 p JBL Mastered Audio Interpolated Torrent Movie Download Ultra Blu Ray Bootable Movie Disc

C# CODE TO EXTRACT EMAIL FROM WEB PAGES FULL TUTORIAL [BUILD A BOT] SALE FOR MONEY

TopBots.BlogSpot.Com
C# More: Features Build A Bot Blogs
Code to Extract Email Addresses

TopBots.BlogSpot.Com

This Info Was Quoted From Jay Stilla and Mister Bots Blooger By Google Blogs. TopBots.BlogSpot.Com [Created By iMyriad CEO Jason Jay Stilla Lee" it is a Informative Social Media Marketing Bots News Blog & That List Free Downloads of Automated Bot Software Apps for Facebook, Twitter, Youtube, Google, Instagram & Social Media Websites Written By Jason "Jay Stilla" Lee Online. His Alias Mister Bots Is Software Creation Specialist whom Develops Marketing Bots and Software Scripts that are Given away at no cost weekly. He Also teaches SEO Secrets and Tools For Advertising" Blogger.Com -TopBots Website Blog https://TopBots.Com < Informative Software and internet Technology News Blog.. Web blogging on new 2015 Bots and 2014's Best Software Bots Automated and Scripted Combined. iMyriads.BigCartel.Com < is a Website Created by Jay Stilla

Code to Extract Email Addresses


The Following is a sample code to Extract Email addresses from a given string and store them into an array.I will give the code as Method, so that you can easily import it into your application.This code can be easily used to extract Email Id’s from a web page, just pass the HTML of the web page as the Text2Scrape.
https://TopBots.Com 

Script:
This Class uses String arrays to store results
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

  1. namespace JayStilla.Mrbots
  2. {
  3. public class ExtractEmails
  4. {
  5. private string s;
  6. public ExtractEmails(string Text2Scrape)
  7. {
  8. this.s = Text2Scrape;
  9. }
  10. public string[] Extract_Emails()
  11. {
  12. string[] Email_List = new string[0];
  13. Regex r = new Regex(@"[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}", RegexOptions.IgnoreCase);
  14. Match m;
  15. //Searching for the text that matches the above regular expression(which only matches email addresses)
  16. for (m = r.Match(s); m.Success; m = m.NextMatch())
  17. {
  18. //This section here demonstartes Dynamic arrays
  19. if (m.Value.Length > 0)
  20. {
  21. //Resize the array Email_List by incrementing it by 1, to save the next result
  22. Array.Resize(ref Email_List, Email_List.Length + 1);
  23. Email_List[Email_List.Length - 1] = m.Value;
  24. }
  25. }
  26. return Email_List;
  27. }
  28. }
  29. }

https://TopBots.Com 

Free EPK from TopBots.Blogspot.com
The following code snippet is the same as the above one, the only difference is that this method saves the Extracted Email Id’s to a string list instead of an array, I think the following code is more effective and easy to code
This class uses List to store results, and these list are converted into arrays just before they are returned as arrays

using System;

using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System. Media;
using System.Threading

  1. namespace TopBots.Media
  2. {
  3. public class ExtractEmailLists
  4. {
  5. private string s;
  6. public ExtractEmailLists(string Text2Scrape)
  7. {
  8. this.s = Text2Scrape;
  9. }
  10. public string[] Extract_Emails()
  11. {
  12. Regex r = new Regex(@"[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}", RegexOptions.IgnoreCase);
  13. Match m;
  14. List results = new List();
  15. for (m = r.Match(s); m.Success; m = m.NextMatch())
  16. {
  17. if (!(results.Contains(m.Value)))
  18. results.Add(m.Value);
  19. }
  20. return results.ToArray();
  21. }
  22. }
  23. }

https://TopBots.Com 
UBot Studio 


Announcing UBot Studio – The First And Best Simple-To-Use, No-Programming-Necessary Bot Maker!


UBot is the internet marketer’s Swiss army knife. While other software attacks SEO, keyword research, and indexing with a chainsaw, UBot grows your business your way using marketing automation that YOU control. With an intuitive drag-and-drop interface and intelligent commands, it simplifies complicated and time-consuming tasks like account creation, article spinning, posting and messaging, on any websites you choose. Just watch a few of the tutorials and you can see how simple it is to stand out from the crowd with your own customized bots.

Other Non Bot Options:https://TopBots.Com