Start from scratch, we’ re gonna use visual studio 2008 for platform and c# for programming. Let’s take a look at some properties in the visual studio.
-We may want to add a ruler to text editor cause we will be dealing with some errors pointing a row number in the editor. So go to Tools / Options / Text Editor / choose C# / be sure there is a tick before Line Numbers line.
O.K. Let’s do some programming. Little from here and little from there.
SENDİNG MAİL
You want to know how you send mail using ASP.NET. Like the other things in ASP.NET it’s easy.
I’m going to use smtp server here and I should know all the detail about my mail server because I will write them down to web.config file.
web.config
<configuration>
<system.net>
<mailSettings>
<smtp from=”some email address”>
<network host=”smtp server name” port=”25″ userName=”username” password=”password” defaultCredentials=”true” />
</smtp>
</mailSettings>
</system.net>
</configuration>
In your aspx.cs file
//To the top of the page write,
using System.Net.Mail;
.
.
.
// and whereever you want, inside class declaration
MailMessage msg = new MailMessage();
msg.From = new MailAddress(”some mail address”);
msg.To.Add(new MailAddress(”some mail address too”));
msg.Subject = Visitormsg.Text;
SmtpClient client = new SmtpClient();
client.Send(msg);
