Sending Email with Attachments (VB.NET/ASP.NET)

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Beginning
Author:
M.V.Rajasekhar

Version Compatibility: Visual Basic.NET, ASP.NET

More information:
These are two functions to send email, both with optional parameters for attachment files. In the first the optional parameter is a string, so you can attach one file. In the second, it is an ArrayList, so that you can attach multiple files. If you are using this in a Windows forms project, you must add a reference to System.Web. See the comments for full details.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: