Skip to main content

Posts

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

Unable to Start Debugging on the Web Server

Check that IIS is running. Make sure that IIS is configured to use Integrated Windows Authentication . Look for the checkbox on the Authentication Method dialog launched from the Directory Security tab of the site properties. Make sure that HTTP Keep Alives are enabled. You'll find that checkbox on the Web Site tab of the properties dialog, in the connections section. Add http://localhost to the trusted sites in Internet Explorer. To tell the truth, this seems to be a fix for the symtoms, not actually fixing the problem itself, but if it works it works. BTW, you'll have to uncheck the “Require server verification (https:) for all sites in this zone“ checkbox to add it as a trusted site.