AddaByte    Programmers' Script Repository
Free and low cost software.
spacer
Find out about our beautiful fractal backgrounds at abm-enterprises


Newsletter Signup
Name
Email
 

  C# - String handling - Use CDO from C# or Vb.Net
 


Save up to 75% on software

Drive Clone

the best name in hosting


add the following reference to your project:
Microsoft CDO for Windows 2000

add the following imports to the top of your code behind page:
using System; 
using System.Web;
using System.Web.Mail;

No security:
CDO.MessageClass oMsg = new CDO.MessageClass();
//string sAttachFile = this.txtAttachFile.Text; // uncomment for attachments
oMsg.To = " dwaterfield@mycompany.com" ;
oMsg.From = (char)34 + " Admin"  + (char)34 + "  "  + strFrom;
oMsg.Subject = " this is a test email." ;
oMsg.TextBody = " Testing 123..." ;
//oMsg.AddAttachment(sAttachFile," " ," " ); //no username or login // uncomment for attachments
oMsg.Send();

With security:
MailMessage mail = new MailMessage();
mail.To = " dwaterfield@mycompany.com" ;
mail.From = (char)34 + " Admin"  + (char)34 + "  "  + strFrom;
mail.Subject = " this is a test email." ;
mail.BodyFormat = MailFormat.Html;
mail.Body = " Testing 123..." ;
mail.Body += " Line 2"  + Environment.NewLine;
mail.Body += " Line 3"  + Environment.NewLine;
mail.Body += " Line 4"  + Environment.NewLine;
mail.Fields.Add(" http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" ," 1" ); 
mail.Fields.Add(" http://schemas.microsoft.com/cdo/configuration/sendusername" , sEUser); 
mail.Fields.Add(" http://schemas.microsoft.com/cdo/configuration/sendpassword" , sEPass); 
SmtpMail.SmtpServer = sEmailServer; 
SmtpMail.Send( mail );
  What does it do?
   no description given
 
  Features
  Added by Added Downloads Rating Popularity

  rpgivpgmr

7:02:28 PM Thursday, June 26th 2008

73

not rated

 
 
  About the file
  Size Download Rate It  

  1568 KB
  download this file
 
 
  Comments
no comments
 
  Add your comment
 Email  
 Subject  
 Comment  
 Verification code:

 
    All comments are screened by the admin prior to being posted
     
 
  Contacts
  Report Abuse