Hi,
i developed the E-mail application.On SEND button Click i write the following code:
MailMessage msg = new MailMessage();
msg.From = new MailAddress(TextBox1.Text);
string[] to = TextBox2.Text.Split(';');
foreach (string t in to)
{
msg.To.Add(new MailAddress(t));
}
if(TextBox3.Text!="")
{
string[] cc=TextBox3.Text.Split(';');
foreach(string c in cc)
{
msg.CC.Add(new MailAddress(c));
}
}
if (TextBox4.Text != "")
{
string[] bcc = TextBox4.Text.Split(';');
foreach (string b in bcc)
{
msg.Bcc.Add(new MailAddress(b));
}
}
msg.Subject=TextBox5.Text;
msg.Body=TextBox6.Text;
if(RadioButtonList1.SelectedValue=="HTML")
msg.IsBodyHtml=true;
else
msg.IsBodyHtml=false;
SmtpClient sc=new SmtpClient();
sc.Host="localhost";
sc.UseDefaultCredentials=true;
sc.Send(msg);
Response.Redirect("send.aspx");
But the appliaction working.I send mail to Yahoo id.When i opened but there is no message in my Inbox.What is the wrong in the above code.Why there is no message in my inbox.
Thanks In advance.
i developed the E-mail application.On SEND button Click i write the following code:
MailMessage msg = new MailMessage();
msg.From = new MailAddress(TextBox1.Text);
string[] to = TextBox2.Text.Split(';');
foreach (string t in to)
{
msg.To.Add(new MailAddress(t));
}
if(TextBox3.Text!="")
{
string[] cc=TextBox3.Text.Split(';');
foreach(string c in cc)
{
msg.CC.Add(new MailAddress(c));
}
}
if (TextBox4.Text != "")
{
string[] bcc = TextBox4.Text.Split(';');
foreach (string b in bcc)
{
msg.Bcc.Add(new MailAddress(b));
}
}
msg.Subject=TextBox5.Text;
msg.Body=TextBox6.Text;
if(RadioButtonList1.SelectedValue=="HTML")
msg.IsBodyHtml=true;
else
msg.IsBodyHtml=false;
SmtpClient sc=new SmtpClient();
sc.Host="localhost";
sc.UseDefaultCredentials=true;
sc.Send(msg);
Response.Redirect("send.aspx");
But the appliaction working.I send mail to Yahoo id.When i opened but there is no message in my Inbox.What is the wrong in the above code.Why there is no message in my inbox.
Thanks In advance.