Process handle

L

Lin

Hello,

I am new to c#, please help.

I am writing an application, which will be able to send email
automatically, for a very large organisation. The application I am
writing should be on the central server, anyone within the organisation
should be able to download the application and run on his/her local
machine without any configuration. The organisation may have quite a
few email servers, so we cannot user server side email API to send
email because this will involve to cofigure the application for
different email server. I plan to use the user's default email client
to send email. If I use mailto protocol in my application, for example,
mailto:?subject=mysubject&body=myemailbody&attachment=somefile.txt,
it seems that the size of text can be put in the email body is very
limited and the attachment attribute doesn't work for all email
client. So I am thinking to use the Process
1) open the client email application
2) get the client email application handle
3) get the input/output stream of the client email application using
the handle
4) write to the client email body

I can only get the first 2 steps done as the following:
Process myPro = new Process();
myPro.FileName = mailto:myemail@somewhere?subject=hello;
myPro.Start();
Handle myHandle = myPro.Handle;

Please give me some advice on how to do this and are there any better
way to do this?

Thanks in advance.

Lin
 
G

gary

Hello Lin,

I think this approach will cause more problems than it will solve. If I
were to do this I'd use the company's smtp server(s). Get around the
problem of multiple smtp servers by providing the details of each in a
config file the user can then choose the appropriate one from a drop
down or similar. Put the application on a central server and deliver
via ClickOnce, that way if the company adds/removes a server any update
will be picked up automatically.

Hope this helps.
 
L

Lin

Hi Gary,
Thank you for your reply, I am afraid that this solution will not work
for my scenario.

Imagine that the application is an NHS employees appraisal form, for
some reason, the application can only be run as a standalone
application. After an employee has filled in the form, the form should
be emailed to the HR and no data should be left on the local computer
because of the sensitivity of the data. In this case, firstly, it is
really difficult to get information for all email severs for such big
organisation, secondly, we should not assume that all people who use
this application understand what email server host is and know the
server name.

Thank you.

Lin
 
M

Michael Nemtsev

Hello Lin,

L> I am writing an application, which will be able to send email
L> automatically, for a very large organisation. The application I am
L> writing should be on the central server, anyone within the
L> organisation
L> should be able to download the application and run on his/her local
L> machine without any configuration. The organisation may have quite a
L> few email servers, so we cannot user server side email API to send
L> email because this will involve to cofigure the application for
L> different email server.

And what's wrong with this approach? Just make the ability for users to set
the desired email server which ones what to use, or depending the user's
location suggest him to use preferable server

---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
G

gary

Lin said:
Hi Gary,
Thank you for your reply, I am afraid that this solution will not work
for my scenaro

I'm sure this approach would work for you Lin, though I will bow to
your superior knowledge of your own enterprise space. You mention that
what you are doing is filling out a form. Would some sort of InfoPath
solution not work for you? Have you looked into it? If not, you can
find out more at
http://office.microsoft.com/en-gb/infopath/default.aspx
 
L

Lin

Hi Gary,
Thank you for your information. I will have a look what this InfoPath
can do.

Thank you,
Lin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top