How to add a Microsoft Outlook Email from ASP.NET application

X

xin.yadong

Is there a way to create an New Outlook Email from an ASP.NET
application? I can not use "mailto:", since it is only support a
string less than 512. I have find a good way from link :
http://zones.advisor.com/doc/17330 , that thread show how to create a
new appointment instead of email. but I have no idea about the format
of a new email. Does any one know the format of a new outlook email
i.e.
Response.ContentType = "text/XXXXXX"
Response.AppendHeader("content-disposition", "inline;
filename=oneEmail.XXXXX")

and the body of the file

Thanks

Lu
 
M

Mark Rae

I can not use "mailto:", since it is only support a string less than 512.

Are you simply trying to send an email from ASP.NET, or do you actually need
interaction from the users...?
 
S

Scott M.

You wouldn't do what you are asking in an ASP.NET application at all.

An ASP.NET application's code runs on the server, not the client (where an
email client would be located) so there's no way to have server-side code
launch a client-side application.

Since users can use any client (browser) to utilize your ASP.NET application
and different browsers come with different email clients (IE comes with
Outlook Express and Netscape comes with its own email client, for example),
even your client-side code (JavaScript) can only *ask* the client (browser)
to launch a new email. The client will do this in whatever email client it
is configured to use (and there is no guarantee that this program will be
Outlook).

The only situation I can see where this would work 100% of the time is one
where you know for sure that each of your visitors will have Outlook and
that their web client has been configured to use Outlook as the default
program to handle email (an intranet). But, even in intranets, there is
always someone who downloads Firefox or Mozilla because they prefer it to
the company choice of IE.

What this leaves you with is 2 choices:

1. Create a web page that contains a form for users to fill out (this form
acts as the email template) and the data is sent via email through your
server-side code.

2. Use the traditional HTML "mailto:" in your client-side code (are you
really running into emails longer than 512 chars?).
 
X

xin.yadong

thanks for your guys reply,
What I am doing is a intranet App, and I am sure every user's pc had
outlook installed. If you take a look of the link of my first post,
you will understand what I am trying to do is just build a new message
draft and download to clientside, which will let IE fire outlook to
open it, after that it will let user modify the draft and decide to
send it or not. The reason I want to let user send email at client
side using outlook is there are some benefits. i.e. save a copy at
"send" folder, input email address from outlooks address book, let
user do some modification and decide to sent it or just save a draft..
 
X

xin.yadong

thanks for your guys reply,
What I am doing is a intranet App, and I am sure every user's pc had
outlook installed. If you take a look of the link of my first post,
you will understand what I am trying to do is just build a new message
draft and download to clientside, which will let IE fire outlook to
open it, after that it will let user modify the draft and decide to
send it or not. The reason I want to let user send email at client
side using outlook is there are some benefits. i.e. save a copy at
"send" folder, input email address from outlooks address book, let
user do some modification and decide to sent it or just save a draft..

BTW, I do know the body of the email will longer than 512 characters,
since those email are reports which willl will be sent between
different departments.
 
S

Scott M.

I think you are missing something here.

Using the simple <a href="mailto:[email protected]">Click here to
send mail</a> does not, in any way, restrict the body of the email.

All that happens is that the client browser will open a new mail message
from whatever email client it uses and a new email message will be provided.
I don't see why this isn't going to work for you. Once that message is
opened, it's business as usual.
 

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

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top