473,695 Members | 2,724 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 4405
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&subj ect=This is the subject&body=Th is 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&subj ect=This is the subject&body=Th is 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&subj ect=This is the subject&body=Th is 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&subj ect=This is the subject&body=Th is 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,
programmaticall y 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******@comca st.net.(donotsp am)> wrote in message
news:D4******** *************** ***********@mic rosoft.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&subj ect=This is the subject&body=Th is 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
12082
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 use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going to do away with our rogue SMTP server access and force everything through Exchange
40
11861
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 following import win32com.client
0
3701
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 days of reading posts and testing, I see it is not - unless I'm missing something? I'm not an email guru. All of my users will be running at least Windows 2000, most on XP sp2. Some of my users will have Outlook, many will be using Outlook...
9
4305
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, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
3
4554
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 windows application it worked fine, however I need to use a service as I don't want to rely on a user being logged in. The errors I get are: Index #:System.Web.HttpException: Could not access 'CDO.Message' object. --->...
14
9129
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 local default SMTP Server and my from address is a valid Yahoo/Hotmail address. I have configures the local SMTP Server to allow the IP Address 127.0.0.1.
8
7281
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 user here at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify,
9
77430
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
5631
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 support .asp,.aspx files, it supports PHP files, I'm searching in JavaScript ,but not found any matter, I'don't Know PHP.I'm having lot of pressure of higer officials.Please help me on this.
5
2155
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 emaill addresses and send emails out. the problem is that all of the email addresses the email is being sent to is showing in the section so everyone knows who's getting the email. How can I have 1 email address showing in the section so no...
0
8649
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8586
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9004
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5842
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4351
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3025
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 we have to send another system
2
2289
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.