-3

I'm working on a WinForms project and am running lines 1 to 7 normally. After the seventh line exits to the for loop (like break;), SendMail() doesn't work. Why?

for (int k = 0; k < 3; k++)
{
    if (mesajlistem[k].InnerText == "test")
    {
        if (saatler[k] != saatlistem[k].InnerText)
        {
            link[k].InvokeMember("click");
            SendMail(document.GetElementById("divItmPrts").InnerHtml); 
        }
    }
}      
Jonathan Carroll
  • 880
  • 1
  • 5
  • 20
Dg Cg
  • 43
  • 1
  • 2
  • 6
  • Have you debugged it? What does `document.GetElementById("divItmPrts").InnerHtml` contain? What do you expect to happen? The seventh line doesn't do anything to exit the `for` loop. Can you add more detail? – Chris Mantle Aug 25 '15 at 17:06
  • http://i.cubeupload.com/qazE3r.png please see this pic. Actually I need programmaticly send latest 3 mails content. – Dg Cg Aug 25 '15 at 17:19

1 Answers1

0

So its seems that mail gets sent but it is empty

So either

documet.GetElement...

is not return the right thing. Or

Sendmail(xx)

is not correct

So set a breakpoint at the start of SendMail and see if good data is being passed in.

Now fix the broken part

(Not an answer I know, but too long for a comment)

pm100
  • 48,078
  • 23
  • 82
  • 145