Open Outlook using C#

G

Guest

Hi,

From my ASP.NET application when the user clicksa button I want to be able
to programmatically open Outlook, create a new mail, add attachments and set
the body text.

Is this possible?

C.
 
G

Guest

So my user can then just select who they want to send it to.

I will add the attachments and text from my application.

The users to receive the email may not be part of the Organisation so I
cannot provide a lookup in the application.
 
X

xAvailx

The users to receive the email may not be part of the Organisation so I
cannot provide a lookup in the application. <<

Why can't you provide the user with a text box and have them comma
delimit the email addresses.
 
K

Kevin Spencer

It is possible, but may not be necessary. If it is necessary, the newsgroup
to ask would be:

microsoft.public.vsnet.vstools.office

--
HTH,

Kevin Spencer
Microsoft MVP
Short Order Coder
http://unclechutney.blogspot.com

The devil is in the yada yada yada
 
X

xAvailx

So, you are saying that I can go to an asp.net website, and asp.net can
open outlook on my client machine and "create a new mail, add
attachments and set the body text"?

Please enlighten me! (no cockiness intended)

Thx.
 
M

Mark Rae

So, you are saying that I can go to an asp.net website, and asp.net can
open outlook on my client machine and "create a new mail, add
attachments and set the body text"?

No - what Kevin and I are saying is that there is no need whatever to open
Outlook on the client machine in order to send an email, as everything you
require (including attachments) is available through the .NET Framework,
specifically the System.Net.Mail namespace: http://www.systemnetmail.com

You must have seen webpages like this before:
http://www.markrae.com/contact/mail.aspx
 
X

xAvailx

is that there is no need whatever to open Outlook on the client machine in order to send an email, <<

I am aware of that.

What the original poster was asking for was to "when the user clicksa
button I want to be able to programmatically open Outlook, create a
new mail, add attachments and set the body text. Is this possible?"

This was so the user can "then just select who they want to send it
to""

Which I replied to no, it is not possible.

Kevin's reply was "It is possible, but may not be necessary".

That is why I am asking how is it possible, because I don't know how...
(btw, I know about office automation, but that would only be possible
 
M

Mark Rae

That is why I am asking how is it possible, because I don't know how...
(btw, I know about office automation, but that would only be possible
on the server end AFAIK).

1) Assuming Outlook is the default mail client, the mailto HTML tag would
launch Outlook on the client. The mailto tag accepts various arguments
including subject, body etc...

2) Otherwise, client-side automation is possible though messy with an
ActiveX control (if all the clients use IE) or a Java applet...

I certainly can't recommend either approach...
 
X

xAvailx

The mailto tag accepts various arguments including subject, body etc... <<

Right, but you can't do attachments.

Right, but this is no longer asp.net realm. You can do pretty much
anything with an ActiveX control.

So we are on the same page. I just wanted to make sure I wasn't missing
something very obvious...

Thx.
 
X

xAvailx

The mailto tag accepts various arguments including subject, body etc... <<

Right, but you can't do attachments.

Right, but this is no longer asp.net realm. You can do pretty much
anything with an ActiveX control.

So we are on the same page. I just wanted to make sure I wasn't missing
something very obvious...

Thx.
 

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