Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do you add attachment to default email program using C# 2005

Posted on 2008-10-09
5
Medium Priority
?
945 Views
Last Modified: 2013-12-17
How do you add attachment to default email program using C# 2005, if you have a collection of images or other file types? How would you go about calling the default email program on somone's PC and automatically attaching the document to that default e-mail provider softwre. (For an example, let's say that this is using Microsoft Outlook 2007)
0
Comment
Question by:hittabusta420
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 18

Accepted Solution

by:
vbturbo earned 2000 total points
ID: 22735941
Hi


for OL 2000 2003 etc...


Using Microsoft.Office.Interop  ;


    private void Button1_Click(object sender, System.EventArgs e) {
        Outlook.Application OutL = new Outlook.Application();
        Outlook.MailItem Mail = ((Outlook.MailItem)(OutL.CreateItem(Outlook.OlItemType.olMailItem)));
        ArrayList al = new ArrayList(2);
        int Counter;
        al.Insert(0, "c:\\Test.xls");
        al.Insert(1, "c:\\Test1.xls");
        al.Insert(2, "c:\\Test2.xls");
        Mail.To = "Mr...";
        Mail.Subject = "Attachments";
        Mail.Body = "Message";
        for (Counter = 0; (Counter
                    <= (al.Count - 1)); Counter++) {
            Mail.Attachments.Add(al[Counter].ToString);
        }
       Mail.Display();
       // Mail.Save();
       // Mail.Send();
        Mail = null;
        OutL = null;
    }




have look here though this is not trough OL.

net 1.1
http://www.systemwebmail.com/

net 2.0
http://www.systemnetmail.com/

vbturbo
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Changing a few Outlook Options can help keep you organized!
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question