Hello,
i have one field name client domain name
where i storing mutiple domain name example:gmail.com,yahoo.co.in
and i have mutiple email address like :
belge.sadhana@gmail.com,belge.sadhana@yahoo.co.in
how to check the domain valid for that email ids.
my code:
if (ds.Tables[0].Rows[0]["DomainName"].ToString() != "")
{
DomainAddress = ds.Tables[0].Rows[0]["DomainName"].ToString();
DEmailAdress = DomainAddress.Split(',');
MutipleEmailID = txtBCCEmail.Text + "," + txtCCEmail.Text + "," + lblToEmailId.Text;
string[] spilitemailids = MutipleEmailID.Split(',');
foreach (string id in spilitemailids)
{
foreach (string s in DEmailAdress)
{
address = new MailAddress(id);
if (!id.Contains("@insyncanalytics.com"))
{
if (!address.Host.Equals(s, StringComparison.OrdinalIgnoreCase))
{
if (id.Contains(s))
{
}
else
{
InvalidDomainEmailAddress.Add(address);
}
}
}
}
}
}
}
}
}
catch (Exception ex)
{
}
finally
{
if (conn.State == ConnectionState.Open)
{
conn.Close();
}
}
return InvalidDomainEmailAddress;
my problem is when i loop two emailids added in arraylist i got belge.sadhana@gmail.com and belge.sadhana@yahoo.co.in.
but this two domain address is exit in the database.
but domain address exit in the database then this email id should not add in arraylist
but how i can get the answer
plz help me