Is there a way to maintain a Windows Form Open if the its main thread was finished.
I was checking on the web but I'm guessing that is imposible and the only way is by assign that form as an external application and open it through a Process Object. But is there is another way I would like to know.
Thanks
Loading
Sam HobbsPosted Aug 12, 2010, 7:03 PM
Hector Hugo Alpizar CesenaPosted Aug 12, 2010, 3:10 PM
theLizardPosted Aug 10, 2010, 6:18 PM
Why not make the email part of your app independent of the app that wants to send the email.
You could achieve this by letting the main application do the email ad write it to a file in a folder called outbox.
The app that will actually send the email looks in the outbox every minute or so or what ever time period you want, and if there are emails to send send them and placed in a sent folder, don't forget, they need to be removed from the outbox.
Hector Hugo Alpizar CesenaPosted Aug 10, 2010, 2:11 PM
I just want to do this
Sender s = new Sender(mailMessageObject, smtpClientObject);
s.sendMail() //this in an indepent process
Ok. My app sends automactily an email every time a record from the data base is insert or changed (Not every time). But the Send method in the Smtp client object takes a lot of time to send the mail (and sometimes it fails). But I think to use the SendAsync method, but then I though that is someone change the record in the dababase and close the app maybe the user will interrupt the sending mail process and the wouldn't be send it. So what I want is my Sending Mail Routine in an indenpent process. I don't want to hook the mail up with outlook because outlook sends a warning when an external app is trying to access it and the user will be confused.
I have the instrucctions in a DLL library and I implemented in a win form but when I close the entire application during the mail sending, the mail is not sended.
I was thinking in created an independent application a call it through the Process object from the Diagnostic libraries. But the arguments are the to Mail, the CC mail and teh BCC mails, Subject and HTML content so... i can't pass all that in the arguments.
Mahesh ChandPosted Aug 10, 2010, 12:28 PM
You need main thread to be running all the time to keep the application running. This thread takes care of all the event handling, display UI and paint/rendering process.
What exactly are you trying to do?