SSIS: Integration services: Throw error from Script Task (Error Handling)

There may be requirement to throw error from Script Task.
Here’s a way to Throw error from Script Task.
//Code Starts Here
Try
‘method which throws an error
Catch e
Me.ComponentMetadata.FireError(-1, “”, “Your Error Message: ” + e.Message, “”, true)
While Not e.InnerException Is Nothing
[...]

SSIS: Logging from script task

This post will show you how to log from the script task.
While logging from inbuilt log system this method helps you to log the exact details of the event in the script task.
using System;
using System.Data;
using System.Math;
using Microsoft.SqlServer.Dts.Runtime;
public class ScriptMain
{
public void Main()
{
[...]

SSIS: Send SMTP mail from Script task

Here i will show how to send SMTP email from a script task rather than the SMTP Mail Task.
Imports System
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Net.Mail
Imports System.Net
Public Class ScriptMain
Public Sub Main()
Dim myHtmlMessage As MailMessage
Dim mySmtpClient As SmtpClient
myHtmlMessage=New MailMessage(name@helpindotnet.blogspot.com,
[...]