Skip to main content

Posts

Showing posts from April, 2007

Sending E-Mail (.NET 2.0)

The System.Net.Mail namespace contains all the classes required for sending mail from within a .NET application. The SmtpClient class handles the actual sending of e-mail. For a simple mail, you can directly pass in the To address, from, subject, and body of the mail to one of the SmtpClient's overloaded send methods. Client application: private void btnSendMail_Click(object sender, EventArgs e) { MailService service = new MailService(); string from = "some@yahoo.com"; string to = "some@yahoo.com"; string subject = "Sending EMails from .NET 2.0"; string body = "Message Body"; service.SendMail(from, to, subject, body); ; MessageBox.Show("Done"); } Sending method: public void SendMail(string from, string to, string subject, string body) { string mailServerName = "yoursmtpserver"; try { //MailMessage represents the e-mail being sent using (MailMessage message = new MailMessage(from...

Find If Assembly Compiled in Debug Or Release Mode

1. Locate and run ildasm.exe application on your mashine 2. From the top menu select Open-> View-> MetaInfo-> Show! 3. Find following text "System.Diagnostics.DebuggableAttribute". You should see something like CustomAttribute Type: 0a00000d CustomAttributeName: System.Diagnostics.DebuggableAttribute :: instance void .ctor(value class DebuggingModes) Length: 8 Value : 01 00 07 01 00 00 00 00 > ctor args: ( ) 4. Value of this attribute for Release Version the value should be Value : 01 00 07 01 00 00 00 00 and for Debug Version it will look like Value : 01 00 02 00 00 00 00 00