aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.UnitTesting/Outlook_TST.cs
blob: b34db8578cf9d9f4da48f0bc7ddd672ebfccdb3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using Microsoft.Office.Interop.Outlook;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace Tango.UnitTesting
{
    [TestClass]
    [TestCategory("Outlook")]
    public class Outlook_TST
    {
        [TestMethod]
        public void Send_Email_With_Logs()
        {
            Application app = new Application();
            MailItem email = (MailItem)app.CreateItem(OlItemType.olMailItem);
            email.Subject = "Machine Studio Test";
            email.To = "roy@twine-s.com";
            email.Body = "Some body";

            email.Attachments.Add(
                    "D:\\C#.txt",
                    OlAttachmentType.olByValue,
                    1,
                    "CSharp Code");

            email.Importance = OlImportance.olImportanceNormal;
            email.Send();
        }
    }
}