By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,866 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,866 IT Pros & Developers. It's quick & easy.

send email with C#

P: n/a
I would like to do the following with C# in my asp.net app:

Open the default email client of the user (just like a mailto: link would).
Supply the subject line and put some HTML (including an image) into the
body of the email.

Any help would be greatly appreciated.

--
Nate Heaton

Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
The ASP.NET application is server-side, and the client's email is
client-side. The server does not have the ability to open applications on
the client.

The web application can send an email using the System.Web.Mail.MailMessage
class, but this would happen transparent to the user and would not involve
email on the client's computer.

You could use html to perform most of what you are describing.
<a href="mailto:jo**@doe.com&subject=This is the subject&body=This is the
body">Click Here.</a>

Hope that helps.

--
Jason Whitted

"nate heaton" wrote:
I would like to do the following with C# in my asp.net app:

Open the default email client of the user (just like a mailto: link would).
Supply the subject line and put some HTML (including an image) into the
body of the email.

Any help would be greatly appreciated.

--
Nate Heaton

Jul 21 '05 #2

P: n/a
If this is the case then what are these people talking about?

HEADING:

"The following is how to launch the systems default email client with a new
message while setting the to,
subject, and message body."

http://www.loresoft.com/Snippets/CSharp/50.aspx

I realize that they are creating a mailto link as you suggested but is there
a way to open the clients email app or not? Also, keeping my eye on the
prize, I am looking for a way to set the Content-type of the email so that I
can put some HTML in the body, otherwise, I will just use the mailto: I have
in place. Thank you for you response.

"JWhitted" wrote:
The ASP.NET application is server-side, and the client's email is
client-side. The server does not have the ability to open applications on
the client.

The web application can send an email using the System.Web.Mail.MailMessage
class, but this would happen transparent to the user and would not involve
email on the client's computer.

You could use html to perform most of what you are describing.
<a href="mailto:jo**@doe.com&subject=This is the subject&body=This is the
body">Click Here.</a>

Hope that helps.

--
Jason Whitted

"nate heaton" wrote:
I would like to do the following with C# in my asp.net app:

Open the default email client of the user (just like a mailto: link would).
Supply the subject line and put some HTML (including an image) into the
body of the email.

Any help would be greatly appreciated.

--
Nate Heaton

Jul 21 '05 #3

P: n/a
They are writing out the same hyperlink I described earlier (passing the
subject and body text) and executing as a server side process. This will
open the server's default mail client on the server, and NOT on the client.

--
Jason Whitted

"nate heaton" wrote:
If this is the case then what are these people talking about?

HEADING:

"The following is how to launch the systems default email client with a new
message while setting the to,
subject, and message body."

http://www.loresoft.com/Snippets/CSharp/50.aspx

I realize that they are creating a mailto link as you suggested but is there
a way to open the clients email app or not? Also, keeping my eye on the
prize, I am looking for a way to set the Content-type of the email so that I
can put some HTML in the body, otherwise, I will just use the mailto: I have
in place. Thank you for you response.

"JWhitted" wrote:
The ASP.NET application is server-side, and the client's email is
client-side. The server does not have the ability to open applications on
the client.

The web application can send an email using the System.Web.Mail.MailMessage
class, but this would happen transparent to the user and would not involve
email on the client's computer.

You could use html to perform most of what you are describing.
<a href="mailto:jo**@doe.com&subject=This is the subject&body=This is the
body">Click Here.</a>

Hope that helps.

--
Jason Whitted

"nate heaton" wrote:
I would like to do the following with C# in my asp.net app:

Open the default email client of the user (just like a mailto: link would).
Supply the subject line and put some HTML (including an image) into the
body of the email.

Any help would be greatly appreciated.

--
Nate Heaton

Jul 21 '05 #4

P: n/a
You are quite right. So is there any way to open the clients email and
automatically put some HTML in the body of the email using code behind in C#
web app?

"JWhitted" wrote:
They are writing out the same hyperlink I described earlier (passing the
subject and body text) and executing as a server side process. This will
open the server's default mail client on the server, and NOT on the client.

--
Jason Whitted

"nate heaton" wrote:
If this is the case then what are these people talking about?

HEADING:

"The following is how to launch the systems default email client with a new
message while setting the to,
subject, and message body."

http://www.loresoft.com/Snippets/CSharp/50.aspx

I realize that they are creating a mailto link as you suggested but is there
a way to open the clients email app or not? Also, keeping my eye on the
prize, I am looking for a way to set the Content-type of the email so that I
can put some HTML in the body, otherwise, I will just use the mailto: I have
in place. Thank you for you response.

"JWhitted" wrote:
The ASP.NET application is server-side, and the client's email is
client-side. The server does not have the ability to open applications on
the client.

The web application can send an email using the System.Web.Mail.MailMessage
class, but this would happen transparent to the user and would not involve
email on the client's computer.

You could use html to perform most of what you are describing.
<a href="mailto:jo**@doe.com&subject=This is the subject&body=This is the
body">Click Here.</a>

Hope that helps.

--
Jason Whitted

"nate heaton" wrote:

> I would like to do the following with C# in my asp.net app:
>
> Open the default email client of the user (just like a mailto: link would).
> Supply the subject line and put some HTML (including an image) into the
> body of the email.
>
> Any help would be greatly appreciated.
>
> --
> Nate Heaton
>

Jul 21 '05 #5

P: n/a
>So is there any way to open the clients email and
automatically put some HTML in the body of the email using code behind in
C#
web app?
no.
"code behind" in a web app runs on the server. if you, in C# code,
programmatically open the default mail program , and your code is running on
the server, that mail program will run on the server, not on the client (web
browser machine).

it may be possible to format a document in .msg format, which outlook
registers itself for, and then download that .msg file to the client via the
browser. In theory this would open up outlook and allow the user to "fill
in" the rest of the message. however, XPSP2 will probably try to block it.
I have never tried this though, so I don't know. I don't know if the .msg
doc format is documented.


"nate heaton" <nh******@comcast.net.(donotspam)> wrote in message
news:D4**********************************@microsof t.com... You are quite right. So is there any way to open the clients email and
automatically put some HTML in the body of the email using code behind in
C#
web app?

"JWhitted" wrote:
They are writing out the same hyperlink I described earlier (passing the
subject and body text) and executing as a server side process. This will
open the server's default mail client on the server, and NOT on the
client.

--
Jason Whitted

"nate heaton" wrote:
> If this is the case then what are these people talking about?
>
> HEADING:
>
> "The following is how to launch the systems default email client with a
> new
> message while setting the to,
> subject, and message body."
>
> http://www.loresoft.com/Snippets/CSharp/50.aspx
>
> I realize that they are creating a mailto link as you suggested but is
> there
> a way to open the clients email app or not? Also, keeping my eye on the
> prize, I am looking for a way to set the Content-type of the email so
> that I
> can put some HTML in the body, otherwise, I will just use the mailto: I
> have
> in place. Thank you for you response.
>
> "JWhitted" wrote:
>
> > The ASP.NET application is server-side, and the client's email is
> > client-side. The server does not have the ability to open
> > applications on
> > the client.
> >
> > The web application can send an email using the
> > System.Web.Mail.MailMessage
> > class, but this would happen transparent to the user and would not
> > involve
> > email on the client's computer.
> >
> > You could use html to perform most of what you are describing.
> > <a href="mailto:jo**@doe.com&subject=This is the subject&body=This is
> > the
> > body">Click Here.</a>
> >
> > Hope that helps.
> >
> > --
> > Jason Whitted
> >
> >
> >
> > "nate heaton" wrote:
> >
> > > I would like to do the following with C# in my asp.net app:
> > >
> > > Open the default email client of the user (just like a mailto: link
> > > would).
> > > Supply the subject line and put some HTML (including an image) into
> > > the
> > > body of the email.
> > >
> > > Any help would be greatly appreciated.
> > >
> > > --
> > > Nate Heaton
> > >

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.