VasquezPL 0 Junior Poster

I have a big problem.
Wheb I try to automate Outlook, I need to make a wrapper...My outlook version is 14.
Unfortunatelly I need my proggy to work on all versions of Outlook.
how to do that?

My code to send email is:

string allbody;
            System.Diagnostics.Process.Start("outlook");
            Outlook._Application oApp = new Outlook.Application();

            //Create the new message by using the simplest approach.
            Outlook._MailItem oMsg = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);

            //Add a recipient.
            // TODO: Change the following recipient where appropriate.
            Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add(x);
            oRecip.Resolve();

            //Set the basic properties.
            oMsg.Subject = "Conference Room Report - "+CRBox1.Text;
            
            //Set Body
            allbody=
            "CONFERENCE ROOM : " + CRBox1.Text +
            "\nLOGIN : " + Environment.UserName +
            "\nDATE : " + date1.Text +
            "\nTIME : " + time1.Text;
oMsg.Body = allbody;
            //Send the message.
            oMsg.Save();
            oMsg.Send();

            // If you want to, display the message.
            //oMsg.Display(true);  //modal

            //Explicitly release objects.
            oRecip = null;
            oMsg = null;
            oApp = null;

is it possible to solve that problem?
thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.