L
lo75
Hello,
I'd like to create an .exe for use outlook and c# ,
someone can say me how to do?
I have a script that works but i don't know how to modify it and then
create the .exe
namespace OutlookEmail
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Email
{
public static msoutl9.Application objOutlook = new
msoutl9.ApplicationClass();
public static msoutl9.Folders objFolders =
objOutlook.GetNamespace("MAPI").Folders;
public static msoutl9.NameSpace objFolder =
objOutlook.GetNamespace("MAPI");
static void Main(string[] args)
{
msoutl9.Application objOutlook = new msoutl9.ApplicationClass();
msoutl9.NameSpace objFolder = objOutlook.GetNamespace("MAPI");
msoutl9.Explorer objExplorer =
objOutlook.Explorers.Add(objFolder.GetDefaultFolder(OlDefaultFolders.olFolderDrafts),
OlFolderDisplayMode.olFolderDisplayNormal);
objExplorer.Activate();
msoutl9.MailItem objMail = (msoutl9.MailItem)
objOutlook.CreateItem(OlItemType.olMailItem);
objMail.To = "user@localhost";
objMail.Subject = "sample email";
objMail.Body = "Hi,\nI'm your sample email.";
objMail.Save();
objOutlook.Quit();
}
}
}
Thanks
I'd like to create an .exe for use outlook and c# ,
someone can say me how to do?
I have a script that works but i don't know how to modify it and then
create the .exe
namespace OutlookEmail
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Email
{
public static msoutl9.Application objOutlook = new
msoutl9.ApplicationClass();
public static msoutl9.Folders objFolders =
objOutlook.GetNamespace("MAPI").Folders;
public static msoutl9.NameSpace objFolder =
objOutlook.GetNamespace("MAPI");
static void Main(string[] args)
{
msoutl9.Application objOutlook = new msoutl9.ApplicationClass();
msoutl9.NameSpace objFolder = objOutlook.GetNamespace("MAPI");
msoutl9.Explorer objExplorer =
objOutlook.Explorers.Add(objFolder.GetDefaultFolder(OlDefaultFolders.olFolderDrafts),
OlFolderDisplayMode.olFolderDisplayNormal);
objExplorer.Activate();
msoutl9.MailItem objMail = (msoutl9.MailItem)
objOutlook.CreateItem(OlItemType.olMailItem);
objMail.To = "user@localhost";
objMail.Subject = "sample email";
objMail.Body = "Hi,\nI'm your sample email.";
objMail.Save();
objOutlook.Quit();
}
}
}
Thanks