Q
qushui_chen
my write code is(i know that is error),how can I do?:
-------------------------------------------------------------------
ThreadArray[m]=new Thread(new ThreadStart(this.send_write_log(
ec_send_email, ec_send_name, es_email, smtp_server, email_format,
et_subject, et_content, esl_id, et_id,es_id,esl_type)));
ThreadArray[m].IsBackground=true;
ThreadArray[m].Start();
function is:
--------------------------------------------------------------------
public void send_write_log(string ec_send_email,string ec_send_name,string
es_email,string smtp_server,bool email_format,string et_subject,string
et_content,int esl_id,int et_id,int es_id,int esl_type)
{
//send Mail
string send_log="";
string code_no;
bool send_flag=false;
if(esmtp.Send(ec_send_email,ec_send_name,es_email,"",smtp_server,email_forma
t,et_subject,et_content))
{
send_log=esmtp.Logs.ToString();
send_log=cm.getEndLine(send_log); //Get End Line String
code_no=cm.getCodeNo(send_log);
send_flag=true;
}
else
{
send_log=esmtp.ErrorMessage;
code_no=cm.getErrorCodeNo(send_log);
}
send_log=cm.limitStringLength(send_log); //fix string "'" and length
int code_no_int=Convert.ToInt32(code_no);
rtb_info.SelectionColor=Color.Green;
//rtb_info.AppendText("Mail Server:"+dns_mx+"\r\n");
rtb_info.AppendText("> "+es_email+" have sent!
"+send_flag.ToString()+"\r\n");
//rtb_info.AppendText(">"+send_log);
//rtb_info.AppendText(">"+send_log.Length.ToString());
if(esl_type!=2)
{
// write the Email send state to send log
rtb_info.AppendText("> write the "+es_email+ " send state to subscribe
send log! \r\n");
e_db_manage.addNewSubscribSendLog(esl_id,et_id,es_id,es_email,code_no_int,se
nd_log);
}
else //on resend mail then update log
{
// write the Email send state to send log
rtb_info.AppendText("> Upstate the "+es_email+ " send state to subscribe
send log! \r\n");
e_db_manage.updateSubscribSendLog(esl_id,et_id,es_id,code_no_int,send_log);
}
}
-------------------------------------------------------------------
ThreadArray[m]=new Thread(new ThreadStart(this.send_write_log(
ec_send_email, ec_send_name, es_email, smtp_server, email_format,
et_subject, et_content, esl_id, et_id,es_id,esl_type)));
ThreadArray[m].IsBackground=true;
ThreadArray[m].Start();
function is:
--------------------------------------------------------------------
public void send_write_log(string ec_send_email,string ec_send_name,string
es_email,string smtp_server,bool email_format,string et_subject,string
et_content,int esl_id,int et_id,int es_id,int esl_type)
{
//send Mail
string send_log="";
string code_no;
bool send_flag=false;
if(esmtp.Send(ec_send_email,ec_send_name,es_email,"",smtp_server,email_forma
t,et_subject,et_content))
{
send_log=esmtp.Logs.ToString();
send_log=cm.getEndLine(send_log); //Get End Line String
code_no=cm.getCodeNo(send_log);
send_flag=true;
}
else
{
send_log=esmtp.ErrorMessage;
code_no=cm.getErrorCodeNo(send_log);
}
send_log=cm.limitStringLength(send_log); //fix string "'" and length
int code_no_int=Convert.ToInt32(code_no);
rtb_info.SelectionColor=Color.Green;
//rtb_info.AppendText("Mail Server:"+dns_mx+"\r\n");
rtb_info.AppendText("> "+es_email+" have sent!
"+send_flag.ToString()+"\r\n");
//rtb_info.AppendText(">"+send_log);
//rtb_info.AppendText(">"+send_log.Length.ToString());
if(esl_type!=2)
{
// write the Email send state to send log
rtb_info.AppendText("> write the "+es_email+ " send state to subscribe
send log! \r\n");
e_db_manage.addNewSubscribSendLog(esl_id,et_id,es_id,es_email,code_no_int,se
nd_log);
}
else //on resend mail then update log
{
// write the Email send state to send log
rtb_info.AppendText("> Upstate the "+es_email+ " send state to subscribe
send log! \r\n");
e_db_manage.updateSubscribSendLog(esl_id,et_id,es_id,code_no_int,send_log);
}
}