Exemplo n.º 1
0
        public static void insertEmailLog(int intSwitchID, string strRecipient, string strClientID, string strMessage, enumEmailPurpose enumPurpose)
        {
            SqlConnection con = new clsSystem_DBConnection(clsSystem_DBConnection.strConnectionString.NavIntegrationDB).propConnection;
            SqlCommand cmd = new SqlCommand();

            con.Open();
            cmd.Connection = con;
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = "[SWITCH_EmailLogInsert]";

            cmd.Parameters.Add("@param_intSwitchID", System.Data.SqlDbType.Int).Value = intSwitchID;
            cmd.Parameters.Add("@param_strRecipient", System.Data.SqlDbType.NVarChar).Value = strRecipient;
            cmd.Parameters.Add("@param_strClientID", System.Data.SqlDbType.NVarChar).Value = strClientID;
            cmd.Parameters.Add("@param_strMessage", System.Data.SqlDbType.NVarChar).Value = strMessage;
            cmd.Parameters.Add("@param_strPurpose", System.Data.SqlDbType.NVarChar).Value = enumPurpose.ToString(); 

            cmd.ExecuteNonQuery();
        }
Exemplo n.º 2
0
        public static void Send(String strRecipient, String strSender, String strSubject, String strBody, int intSwitchID, string strClientID, enumEmailPurpose enumPurpose)
        {
            String strSMTPHost = new clsEmail().strSMTPHost;

            MailAddress from = new MailAddress(strSender);
            MailAddress to = new MailAddress(strRecipient);

            MailMessage message = new MailMessage(from, to);
            message.Subject = strSubject;
            message.Body = strBody;
            message.IsBodyHtml = true;

            SmtpClient client = new SmtpClient();
            client.Host = strSMTPHost;

            client.Send(message);

            insertEmailLog(intSwitchID, strRecipient, strClientID, strBody, enumPurpose);
        }
Exemplo n.º 3
0
        public static void insertEmailLog(int intSwitchID, string strRecipient, string strClientID, string strMessage, enumEmailPurpose enumPurpose)
        {
            SqlConnection con = new clsSystem_DBConnection(clsSystem_DBConnection.strConnectionString.NavIntegrationDB).propConnection;
            SqlCommand    cmd = new SqlCommand();

            con.Open();
            cmd.Connection  = con;
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = "[SWITCH_EmailLogInsert]";

            cmd.Parameters.Add("@param_intSwitchID", System.Data.SqlDbType.Int).Value       = intSwitchID;
            cmd.Parameters.Add("@param_strRecipient", System.Data.SqlDbType.NVarChar).Value = strRecipient;
            cmd.Parameters.Add("@param_strClientID", System.Data.SqlDbType.NVarChar).Value  = strClientID;
            cmd.Parameters.Add("@param_strMessage", System.Data.SqlDbType.NVarChar).Value   = strMessage;
            cmd.Parameters.Add("@param_strPurpose", System.Data.SqlDbType.NVarChar).Value   = enumPurpose.ToString();

            cmd.ExecuteNonQuery();
        }
Exemplo n.º 4
0
        public static void SendWithAttachment(String strRecipient, String strSender, String strSubject, String strBody, int intSwitchID, string strClientID, enumEmailPurpose enumPurpose, string strAttachment)
        {
            String strSMTPHost = new clsEmail().strSMTPHost;

            MailAddress from = new MailAddress(strSender);
            MailAddress to   = new MailAddress(strRecipient);

            MailMessage message = new MailMessage(from, to);

            message.Subject    = strSubject;
            message.Body       = strBody;
            message.IsBodyHtml = true;
            message.Attachments.Add(new Attachment(strAttachment));

            SmtpClient client = new SmtpClient();

            client.Host = strSMTPHost;

            client.Send(message);

            insertEmailLog(intSwitchID, strRecipient, strClientID, strBody, enumPurpose);
        }