my project is supply chain managment and i want to send mail in asp.net when inventry is low then i want to send mail ...total inventory is 50...this is code which i done in submit button now in this submit button i also send mail when inventory is low ..how i done this

 b = inv.get_Inv(Convert.ToInt32(ddl_product.SelectedValue));

        d = inv.get_reorder(Convert.ToInt16(ddl_product.SelectedValue));
        if (b > 0 && b >= Convert.ToInt32(Txtquantity.Text))
        {
            c = b - Convert.ToInt32(Txtquantity.Text);
            saleorderid = 
            (DLL.ClassSales.addsales(Convert.ToInt32(ddl_customer.SelectedValue), 
                   Convert.ToDateTime(Calendar1.SelectedDate), 
              Convert.ToInt16(ddl_status.SelectedValue))).ToString();

            DLL.ClassSales.addsaleOrderDetail(Convert.ToInt16(saleorderid), 
          Convert.ToInt32(ddl_product.SelectedValue), 
             Convert.ToDecimal(Txtupprice.Text), Convert.ToInt32(Txtquantity.Text));

   DLL.ClassInventory.Update_inventory(Convert.ToInt32(ddl_product.SelectedValue), c);
        }
        if (c <= d)
        {  // alert and email (main menu pe jana chahiye)
            Response.Redirect("Purchases.aspx");
        }
        else
        {
            //Label1.Text = "Inventory invalid";
        }
有帮助吗?

解决方案

This answer show how you could send an email using C#.

Just remember to specify an STMP server that you have access to from your server. Your hosting provider might or might not supply this for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top