Move set variables codes from event button click to SendHTMLMail()
protected void Button7_Click(object sender, EventArgs e)
{
MailBody obj = new MailBody();
obj.TxtInvoice = TxtInvoice.Text;
obj.txtEmail = txtEmail.Text;
obj.lblMessage = lblMessage.Text;
SendHTMLMail();
}
public void SendHTMLMail()
{
MailBody obj = new MailBody();
obj.TxtInvoice = TxtInvoice.Text;
obj.txtEmail = txtEmail.Text;
obj.lblMessage = lblMessage.Text;
string name;
string mobileNo;
string email;
string check_In;
string Check_out;