The mailto: command is very useful when only basic parameters need to be
sent, such as the To field, but not so useful when a large chunk of HTML
formatted body text must also be sent. I basically want my app to to create a
full new mail message (in the default mail client, usually Outlook), which
the user can then modify and send. Specifying
"mailto:so*****@domain.com?body=XXX" will not suffice, as the body text is
too long and must be HTML formatted.
--
James. 9 13523
hi, The mailto: command is very useful when only basic parameters need to be sent, such as the To field, but not so useful when a large chunk of HTML formatted body text must also be sent. I basically want my app to to create a full new mail message (in the default mail client, usually Outlook), which the user can then modify and send. Specifying "mailto:so*****@domain.com?body=XXX" will not suffice, as the body text is too long and must be HTML formatted.
you could create an .eml file and open that.
crea
Hi James,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to create an HTML format email
message in your app. If there is any misunderstanding, please feel free to
let me know.
As far as I know, we can use classes under System.Web.Mail namespace to
achieve this. Creating a MailMessage object will create a mail message. We
can also use MailAttachment class to add attachments to particular message.
The following link provides an example: http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwebmailmailmessageclasstopic.asp
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Thanks for the advice. It is true that I am aiming to create an
HTML-formatted email, but the System.Web.Mail namespace is not suitable.
Outlook is a very powerful and effective tool, and having generated the
email, I would like the user to be able to edit it using Outlook before
sending. Also I can't make the SmtpMail.SendMessage(MailMessage message)
method work - although this doesn't really matter, as it's not what I want.
Would the creation of an .eml file - as Crea-Ue. Kirdar suggested - be
possible, and if so, how is this most easily done? Is there an alternative?
Thanks for the suggestions, but Outlook automation is not really what I'm
looking for. My previous post was unclear - I don't actually mind whether the
user's default mail program is Outlook, Outlook Express or any other app. As
I understand, creating a .eml file and opening it in the default mail program
with System.Diagnostics.Process.Start("C:\email.eml") would be ideal. I
cannot, however, find any samples or tutorials to achieve this. Can you
please provide some links for creating .eml files with C# (not the Expert's
Exchange, as I don't have a subscription)? I would ideally prefer not to
involve any 3rd party or COM components.
Many thanks in advance,
James.
Hi James,
If you need to create an .eml file, you can just use File.Create method to
create a blank file with the extension .eml. Then use
System.Diagnostics.Process.Start("C:\email.eml") to start it. But this is
only a received message and you cannot modify it.
It seems that we cannot parse a .eml file without using MAPI.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Hi James,
Yes, Outlook automation doesn't work on those computers that don't have
Outlook installed. Currently I can't find any sample which use code to
create a .eml file. An email message is always a simple ASCII text file. An
.EML file is a Microsoft extension used to denote an email file; thus
myemail.eml is an ASCII text file as received by your email client. The
file is still a simple ASCII text file that can be read by Notepad or any
other text editor. You can modify the content directly like the following.
Subject:
Date: Wed, 1 Sep 2004 16:08:24 +0800
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0006_01C4903D.F386A970"
X-Priority: 3
X-MSMail-Priority: Normal
X-Unsent: 1
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C4903D.F386A970
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
------=_NextPart_000_0006_01C4903D.F386A970
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_0006_01C4903D.F386A970--
I will try to find if there is any other APIs that can do. But seems to be
hopeless.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Hi James,
You can refer to the following link to use CDO. http://msdn.microsoft.com/library/de...us/cdosys/html
/_cdosys_messaging_examples_creating_and_sending_a_ message.asp
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Thank you very much for your help. I'll test it all over the next couple of
days and post back if I have any problems/success. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ben Finney |
last post by:
Howdy all,
In searching for tools to run automated regression tests against a Web
aplication, I found (amid a number of tools requiring non-free Java) the
WebUnit code:
...
|
by: Val |
last post by:
Any experts on mailto: tags?
I want to set a link so that the subject and some of the body of the
email is filled in. This is easy for simple text, although you need to
use %20 for spaces:
<a...
|
by: Steven T. Hatton |
last post by:
Now that I have a better grasp of the scope and capabilities of the C++
Standard Library, I understand that products such as Qt actually provide
much of the same functionality through their own...
|
by: Adam Smith |
last post by:
How can I set up a mailto with a cc or bcc as well as a subject
designation. The system works for two but not three, is this a hardwired
limit or have I missed something
==>
<a...
|
by: binarybana |
last post by:
After recently getting excited about the possibilities that stackless
python has to offer
(http://harkal.sylphis3d.com/2005/08/10/multithreaded-game-scripting-with-stackless-python/)
and then...
| |
by: Bret Pehrson |
last post by:
Since managed code (C++/C#/etc.) doesn't support multiple inheritance, does
anyone have a suitable work-around? To me, this is a *serious* limitation of
the .NET subsystem.
I'm aware of...
|
by: chris |
last post by:
Hello all -
Preface: This isn't a C# Builder question but if you happen to have the
answer to my primary problem, please feel free to chime in ;-)
I'm using Borland's C# Builder (Personal)...
|
by: Josh Mcfarlane |
last post by:
Just out of curiosity:
When would using std::list be more efficient / effective than using
other containers such as vector, deque, etc?
As far as I'm aware, list doesn't appear to be...
|
by: mahesh.kanakaraj |
last post by:
Hi All,
I have a confusion in finding the 'effective content' of a complex
type
definition in a XML Schema.
I shall give you an example situation to clearly explain my problem.
Let's have...
|
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,...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |