Burak Ozdemir 's Blog
Computer Science & Softwares - Latest Technology


Where people meet new technology !


Getting MX record from DNS

Programming No Comments »

First of all, if you downloaded and tried the Tiny Mailer (Download link is below), you should be realized that program making a direct connection to Mail Exchange servers and sending your mail. But how to obtain the ip address of the mail exchange server from the given receiver’s mail address.The trick is there, if you know the ip address of the mx server then you can make a direct connection as a normal SMTP Client and send your mail. Below there is a small code piece that shows how you can do this process in C# .Net. This little piece of code takes advantage of using “nslookup” tool. It opens the “nslookup” in the background make a query for a given host then returns the output to a string, then the first mx record is parsed and returned from the function.

public string getmxserver(string hostname)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = “nslookup”;
proc.StartInfo.Arguments = “-type=mx ” + hostname;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.StartInfo.CreateNoWindow = true;
proc.Start();
StreamReader pout = proc.StandardOutput;
string s = pout.ReadToEnd();
string[] snew = s.Split(’,');
string[] snew2 = snew[1].Split(’=');
string[] snew3 = snew2[1].Split(’ ‘);
string[] snew4 = snew[1].Split();
string mxserver = snew4[4];
return mxserver;
}

As you can see it is the simplest way of Getting MX record. I hope this would be helpful to those who are intended in coding SMTP client.

Some funny and weird photos

Fun 2 Comments »

Sometimes I surf through some fun sites and catch interestingly funny photos, let me share them with you :)

1577.jpg Mighty Darth Vader taking a ride in the city…

1889.jpg This one is a stupid logo , take a look…

1947.jpg Do you want cheap residents?

1953.jpg Don’t do this !!!

1963.jpg Do you want candy nice guy?

bush-iq.jpg This is not very interesting :)

So please leave some comments …

C# Mail Client & Sending Mail With C# .NET

Programming No Comments »

As I mentioned below, the first small tutorial will be about writing a small mail client (smtp client). Before starting to tutorial, you have to design a simple GUI (graphical user interface) like below screen shot, a simple interface is enough. In this mail client we will use System.Net.Mail library to create mail and smtp client objects. Our code will be similar to below code piece,

MailMessage mymes = new MailMessage();
mymes.To.Add(new MailAddress(toTextBox.text);
mymes.From=new MailAddress(fromTextBox.text);
mymes.Subject=subjectTextBox.text;
mymes.Body=bodyTextBox.text;
SmtpClient myclient = new SmtpClient(”smtp server host address as string”);
myclient.Send(mymes);

It is easy as it is. It is extremely short and easy to understand (8 lines as you see), the complexity may emerge, if the smtp server needs authorization and maybe it need a ssl connection to authorize username & password (credentials). I leave those to ones who are interested in more than a simple stmp client, if you have any question or help please leave a comment.

An example GUI:
gui.png

New Category

Programming No Comments »

I have decided to open a new category in my blog to improve the content and try to share something useful, the new category will be about programming, I will giving small tutorials about various kinds of programming languages, but mainly based on c# and c++. The first small tutorial will be about writing a small smtp mail client with c# using .NET.

What is .NET Framework 3.0 ?

Technology No Comments »

It is formerly known as WinFX. It is the newer version of .Net Framework platform. It is grants a backward compatibility to Framework version 2.0, and also it includes some new technologies.

What about the new technologies?

Windows Presentation Foundation (WPF, formerly code-named “Avalon”) :
Provides classes for building next-generation smart-client applications that combine UI, documents, and media.

Windows Communication Foundation (WCF, formerly code-named “Indigo”) :
Offers a unified programming model and runtime for building service-oriented applications.

Windows Workflow Foundation (WF) :
Offers a programming model, engine, and tools to build workflow-enabled applications that model business processes.

Windows CardSpace (formerly code-named “InfoCard”) :
Provides a technology for simplifying and improving the safety of working online with personal identity information.

Microsoft .NET Framework 2.0 :
Enables productively building Windows and Web-based applications.

The above technologies represent as new classes WPF, WF, WCF, and CardSpace in System Namespace, and also the core classes from .NET Framework 2.0 remain as they are.

There is a structure diagram of .NET Framework 3.0 below:

fw3.png

Check the below site for further information, the above diagram and some partial content were taken from:

http://msdn2.microsoft.com/en-us/library/aa480198.aspx

Click here to download .NET Framework 3.0 from Microsoft.com

Note: Remember that .NET Framework comes installed with Windows Vista.

South Park Butters Job Generator

Fun 2 Comments »

How about a little fun after all serious posts :) ? Look there is a job generator , It is not another Job Generator, it is Butters Job Generator , change your life ! Take an advice from Butters.
lu lu lu I’ve got some apples lu lu lu You’ve got some too lu lu lu Let’s make some applesauce Take off our clothes and lu lu lu

Download It Now! (You will need .NET Framework 2.0 to run this application.)

butters.jpg

VMware and VMware images

Software No Comments »

vmware.jpg

What is VMware?
-Lets you to run another Operating System when your current Operating System is running.

Where to get it?
- http://www.vmware.com/products/ws/

Why to use VMware?
-Simply it is very useful for testing purposes, you may test your software’s compatibility on other OSes. Also you may
actually want to test an OS itself before considering to install it to your machine.

How to get an Image?
-You may install an OS by hand on VMware and then you can make your own image or you may get an existing image from somewhere.
(Check below links.)

How many available images?
-There are many, Windows 95/98/2000/XP/Vista , Linux , SOLARIS , BSD based Oses.

Does VMware Support all OSes?
-Currently it is supporting all existing OSes.

Where Can I download images?
-Check the below links, i put some OS image torrents.

I have tried it myself, found it really useful, I have installed SOLARIS , Debian Linux to Windows XP, results are great, performance can be considered as good. Actually it depends how much memory and hard disk space that you allocated for the OS, typically 256 and more will perform better, also hard disk space depends which application(s) you will install to the OS.

VMware Image Downloads
Debian Sarge (115 MB)
Fedora Core 4 (283 MB)
Fedora Core 5 (976 MB)
Fedora Core 6 (873 MB)
Fedora Core 7 (890 MB)
Fedora Core 7 (898 MB) newer version!
FreeBSD 6.0 (129 MB)
FreeBSD 6.1 (172 MB)
FreeBSD 6.2 (235 MB)
Ubuntu Server 6.06 (172 MB)
Ubuntu Server 6.10 (171 MB)

Copyright Protected ©2007 http://www.buraak.com
Contact info : <burak [at] buraak [dot] com>
Entries RSS Comments RSS Login
eXTReMe Tracker

Privacy Policy