Sending an Email


Sending an email using VBScript can be done using Collaboration Data Object (CDO) messaging. But it is supported only in Windows 2000, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows XP Operating Systems. To create object for CDO, cdosys.dll should be installed in your machine and many users reported failure when CDO is implemented in Windows 7. Then what is the solution for this problem?
We have an alternative, which is System.Net.Mail .Net class. Microsoft introduced this class when .Net Framework 2.0 was launched. The following are the major benefits of Net.Mail class,
  • CDOSYS.dll installation is not required to send an e-mail.
  • More powerful than CDO messaging.
  • Attaching file with message is very simple like adding recipients.
  • Attachment can be done for a filename or a stream.

Code


Synopsis

System.Net.Mail class is not dependant upon COM and it is more versatile than CDO messaging.
Note: We can also embed an image into the message using LinkedResource class.
Reference: http://www.systemnetmail.com/

Leave a Reply

Your email address will not be published. Required fields are marked *