473,505 Members | 13,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

send email with C#

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
5 4387
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
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
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
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
>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
12039
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
40
11781
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
0
3673
by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after...
9
4292
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
4536
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
9105
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
8
7264
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
9
77407
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
2
5620
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
5
2147
by: Mike | last post by:
I have a page with a textbox that a user can enter in mutliple email addresses such as: user1@yahoo.com;user2@yahoo.com;user3@gmail.com; and so on, I then have a foreach loop to get all of the...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.