本文介绍了发送批量电子邮件的服务器端问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我遇到一个奇怪的问题.我做了一个功能,可以将邮件发送给n个用户,目前我只有181个.我每天向他们发送邮件,并且在处理结束时,标签上会显示"Success"(成功)文本,与此同时,我记下了历史记录,然后通过在成功发送电子邮件后出现的按钮在网格视图中显示了历史记录.我刚刚启动了我的项目,最初情况很好,但是今天我看到我已经发送了电子邮件,并且过程很早以前就完成了,但是我的进度图像仍然在旋转,让我认为过程仍在继续.比当我单击页面上某处的链接时,它让我注销了.登录后,我进入我的历史记录页面,看到成功记录了历史记录并且成功发送了邮件,但是在此过程中,没有出现成功消息,并且进度图像也没有消失.为什么会这样呢?是由于某些页面渲染还是来自服务器的回发问题.当我在本地对其进行测试时,它的工作原理绝对不错.我担心如果这种情况继续发生,将会给我的项目带来麻烦.
我没有发布代码,因为流程运行正常,只有确认是一个问题.

Hi,

I am suffering from a strange problem. I made a functionality in which we can send mails to n number of users how far i just have 181 at the moment. I send them mails on daily basis and at the end of process the label appears with text "Success" and at the same time I make note of history which I show afterwards in grid view through a button that appears after sucesfull sending of emails. I have just launched my project and initially it was fine but today I saw that I have send emails and process was completed long ago still my progress image was there revolving and made me assume that process is still going on. Than when I clicked on the link somewhere on the page it logged me out. After logging in and I went to my history page and saw that history was succesfully recorded and mails were succesfuly sent but during the process the success message didn''t came up and neither the progress image dissapeared as it was supposed to be. Why did that happen ? Is it due to some page rendering or post back issue from server. When i tested it on local it was working absolutely fine. I am scared that if this will continue to happen It will create issues for my project.
I didn''t posted the code because process is working fine only the confirmation is an issue.

for (int ict = 0; ict < dtRecords.Rows.Count; ict++)
{

    int iWorkOrderNumb = Convert.ToInt32(dtRecords.Rows[ict]["WorkOrderNumber"]);
    string strworkOrder = Convert.ToString(dtRecords.Rows[ict]["WorkOrderName"]);
    string strdata = Convert.ToString(dtRecords.Rows[ict]["DataType"]);
    string strHSCODE = Convert.ToString(dtRecords.Rows[ict]["HSCODE"]);
    string strCombination = Convert.ToString(dtRecords.Rows[ict]["Combination"]);
    string strProd = Convert.ToString(dtRecords.Rows[ict]["Product"]);
    string strProd_Not = Convert.ToString(dtRecords.Rows[ict]["Product_Not_Like"]);
    string strActive = Convert.ToString(dtRecords.Rows[ict]["IsActive"]);
    string strEmailId = Convert.ToString(dtRecords.Rows[ict]["EmailId"]);
    string strPortname = Convert.ToString(dtRecords.Rows[ict]["Ind_Port"]);

    DateTime date_from_subscp = Convert.ToDateTime(dtRecords.Rows[ict]["DateFrom"]);
    DateTime date_to_subscp = Convert.ToDateTime(dtRecords.Rows[ict]["DateTo"]);

    if (strActive == "NO")
    {

        DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
        strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
    }


    else if (strActive == "YES")
    {

        //((date_from_for_daily_email < date_start) ||
        if (date_to_for_daily_email > date_end)
        {
            //lblMsg.Visible = true;
            //lblMsg.Text = "You cannnot select a date less than last mailed date and greater than " + date_end.ToString("dd-MMM-yyyy") + ".";
            String strmsg = "You cannnot select a date less than last mailed date and greater than " + date_end.ToString("dd-MMM-yyyy") + ".";
            PopUp_Generation(strmsg);
        }
        else if (date_from_for_daily_email > date_to_for_daily_email)
        {
            //lblMsg.Visible = true;
            //lblMsg.Text = "Invalid date range. Please check the dates and than try again...";
            string strmsg = "Invalid date range. Please check the dates and than try again...";
            PopUp_Generation(strmsg);
        }

        else if (date_to_subscp < date_to_for_daily_email)
        {

            DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
            strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";

        }


        else
        {
            string[] strArr_email_list = null;
            strEmailId = strEmailId.TrimEnd(',');
            strArr_email_list = strEmailId.Split(',');
            for (int i_count_email = 0; i_count_email < strArr_email_list.Length; i_count_email++)
            {
                string strEmailID_of_User = Convert.ToString(strArr_email_list[i_count_email]);
                iResult = bl_Query_for_admin.Query_Data_Email_Attachment(iWorkOrderNumb,strworkOrder, strdata, date_from_for_daily_email, date_to_for_daily_email, strHSCODE, strCombination, strProd, strProd_Not,strPortname,strEmailID_of_User);
                if (iResult == 1)
                {
                    strSucessEmail += "" + strEmailID_of_User + ", ";
                }
                else
                {
                    DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
                    strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
                }


                if (iResult == 1)
                {
                    if (flag == 0)
                    {
                        bl_myAccount.insert_last_daily_email_date(date_to_for_daily_email);

                        flag = 1;
                    }
                    lblMsg.Visible = true;

                    lblMsg.Text = "Email Sent Succesfully !!!";
                    continue;
                }




            }


        }

    }

}





btnLog.Visible = true;
gvAllClients.Visible = true;
Session.Remove("chk_state");
inserting_mail_history(ref strSucessEmail, ref strFailedEmail);


请向我建议原因并解决问题!


Please suggest me the reason and cure !

推荐答案


这篇关于发送批量电子邮件的服务器端问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 02:54
查看更多