protected void MailSend()
{
ar = (ArrayList)Session["Detail"];
//ar = (string[])Session["User_Info"];
string To_email = ar[4].ToString().Trim();
MailMessage Mail = new MailMessage();
MailAddress ma = new MailAddress(ConfigurationManager.AppSettings["AdminId"], ConfigurationManager.AppSettings["Name"]);
Mail.From = ma;
Mail.To.Add(To_email);
Mail.IsBodyHtml = true;
Mail.Subject = "Subject";
//string bdy = "Dear " +ar[1].ToString()+ "
" + "Thanks for registration on Universal Export mart your password is " +ar[5].ToString() + " " + "we will give you a confirmation mail after that you can sell your items on our site
" + "Support Team " + "
" + "Universal Export mart";
string bdy = "Dear " + ar[1].ToString() + "
" + "Thanks for registration on Universal Export mart your password is " + ar[5].ToString() + " " + "we will give you a confirmation mail after that you can sell your items on our site
";
Mail.Body = bdy;
SmtpClient smtpMailObj = new SmtpClient();
//eg:localhost, 192.168.0.x, replace with your server name
smtpMailObj.Port = 465;
smtpMailObj.Host = ConfigurationManager.AppSettings["Host"];
smtpMailObj.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["AdminId"], ConfigurationManager.AppSettings["Password"]);
smtpMailObj.Send(Mail);
lblError.Text = "Mail sent successfully";
Abhimanyu K VatsaPosted May 31, 2010, 7:26 AM
No question found....clarify it first to get correct answer.
Good Luck