473,662 Members | 2,547 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attach An outlook message to an outlook message

How do I attach an outlook email message as an attachment within
another outlook email message.

Right now I am using the following code. But I was wondering if there
is a better way to do this without using a file that needs to be
deleted later.

private MailMessage addAttachment(M ailMessage Mail, MailItem item)
{
string path "Messages\\mess age" + message_id+ ".MSG";
Mail.IsBodyHtml = true;
item.SaveAs(pat h,
Microsoft.Offic e.Interop.Outlo ok.OlSaveAsType .olMSG);
System.Net.Mail .Attachment attach = new
System.Net.Mail .Attachment(pat h);
attach.Name = "OriginalMessag e.MSG";
Mail.Attachment s.Add(attach);
message_id++;
}

May 14 '07 #1
0 1280

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3703
by: tabonni | last post by:
Hi I try to grab the checked files from HTML page and then send those PDF files as attachments. It can just send email, there are no PDF files attached. Can anybody point out my error? My idea is: When people check the check boxes in HTML page for the PDF files, it will transfer the files' name to ASP page. Then, it will attach it in the email.
3
4757
by: Wizard | last post by:
In Access, using VBA, I am sending emails based on query results. These email include relevant information to a scheduled event the recipient is assigned to. This is working great. What I have been ask to do now is to include an attached file, that when opened will be an Outlook Calendar event and when saved the event will be added to the recipient's calendar in Outlook. These files are .vcs files. I am able to create the necessary...
0
905
by: Catherine | last post by:
Hello, On Visual Studio .NET 2003 when i try to attach the Outlook process for debugging I receive systematically this error “Enable to attach to the process” I try on the computer of my partners and everything was ok I don’t understand it’s exactly the same machine (rights, service pack and applications). Anybody have a idea about this error, thanks a lot.
0
1042
by: Catherine | last post by:
Hello, On Visual Studio .NET 2003 when i try to attach the Outlook process for debugging I receive systematically this error “Enable to attach to the process” I try on the computer of my partners and everything was ok I don’t understand it’s exactly the same machine (rights, service pack and applications). Anybody have a idea about this error, thanks a lot.
9
3040
by: Matthias Haberkorn | last post by:
Hello, I haved used VS2003 and send some Reports as EMail attachmend with vb.net. The code looks like this: Dim pdfOpts As PdfRtfWordFormatOptions = _ ExportOptions.CreatePdfRtfWordFormatOptions() Dim MailOptions As MicrosoftMailDestinationOptions = _ ExportOptions.CreateMicrosoftMailDestinationOptions() Dim exportOpts As ExportOptions = New ExportOptions
12
2771
by: cj | last post by:
What's the parameter (like ?attachment) or something.
1
2688
by: andyoye | last post by:
Below code is attached with a button on my infopath form. It does work ( auto populates "To:" and "Subject" based on form nodes) but how can I attach the file to the message which is attached to attachment control to the form? Thanks public void Email_Clicked(object sender, ClickedEventArgs e) {
0
980
by: mghannom | last post by:
Hello, Plz can you help me on this isssue: i have windows application with visual basic .net 2003 and i need attach outlook mail on it.
0
1738
by: sandeep98811 | last post by:
I am getting following weird issue, "When forwarding an email with an open attachment the user warned twice that an attachment is open". I am catching Forward event of mail item in function _mail_Forward(). Steps to reproduce issue: 1. Open email , open attachment 2. Click on Forward Button, 3. Outlook displays message "The attachment "test" is open or in use by another application. If you continue, you will lose any changes you...
0
8344
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
8764
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
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7367
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 projectplanning, coding, testing, and deploymentwithout 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
4180
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...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
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
1993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1752
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.