ahmed sa

ahmed sa

  • NA
  • 289
  • 125.5k

Yahoo email account not open after i write this code in c#

Apr 21 2015 9:55 AM

Hi guys i make send email by this code 

but after one week the yahoo account  not open why 

the yahoo account not open is [email protected]

and this is my code 

string smtpAddress = "smtp.mail.yahoo.com";int portNumber = 587;
bool enableSSL = true;
string emailFrom = "[email protected]";
string password = "passw#rd";
string emailTo = "[email protected]";
string subject = "Working Finish today" + label6.Text;
string body = "Summary for Date" + "" + label6.Text + "" +
"Quantity Required" + "" + "(" + label17.Text + ")" + "/" +
"Quantity Shipped""/" + "(" + label18.Text + ")" + "/" +
"Quantity Remaining" + "/" + "(" + label19.Text + ")";
using (MailMessage mail = new MailMessage())
{
mail.From = new MailAddress(emailFrom);
mail.To.Add(emailTo);
mail.Subject = subject;
mail.Body = body;
mail.IsBodyHtml = true;
mail.Attachments.Add(new Attachment("I:\\gridview" + DateTime.Today.ToString("dd-MM-yyyy") + ".csv"));
System.Net.Mail.SmtpClient smtp = new SmtpClient(smtpAddress, portNumber);
smtp.Credentials = new NetworkCredential(emailFrom, password);
smtp.EnableSsl = enableSSL;
smtp.Send(mail);
 }

What is wrong in this code 

I create account by yahoo two times 

and after this open may be 6 days and after this not open

and cannot open your yahoo account after this i try from another computer but not open

i check caps lock and every thing and language and i write in files before i open 

but not accept to open

Why 


Answers (1)