-1
私は新しいユーザーで、C#.netの初心者です。これが私の最初の質問です。私はフォルダ内の私のローカルドライブにOutlook電子メールを保存しました。事は、私は新しい身体で電子メールに返信や返信をしなければならないということです。以下は私が今までに書いたコードです。私は()でCreateItemFromTemplateで新しい(返信)メッセージを返すMailItem.Reply
ローカルドライブに保存されているOutlook電子メールに返信するにはどうすればよいですか?
public void IterateMessages(string folderPath, string folderName, string emailName, string attachmentPath, string Subject, string mailDate, string To, string SenderName)
{ try
{
string uBank = string.Empty;
string efolderPath = folderPath + "\\Emails\\";
string tempSubject = string.Empty;
string tempMailDate = string.Empty;
string tempTo = string.Empty;
string tempSenderName = string.Empty;
string tempSName = string.Empty;
string eBody = " Hi,<br /><br /> Body here... <br /> <br /><br /><br /><br />";
//Getting the Folder name from the Path given
foreach (string frname in Directory.GetDirectories(efolderPath))
{
string[] vfolder = frname.Split('\\');
uBank = vfolder.Last(); //getting foldername
if (uBank == folderName) //Comparing values for Validation
{
string[] Files = Directory.GetFiles(frname + "\\", "*.msg", SearchOption.TopDirectoryOnly);
for(int i=0; i < Files.Length; i++)
{
Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();
var item = app.Session.OpenSharedItem(Files[i]) as Microsoft.Office.Interop.Outlook.MailItem;
item.Display();
item.Reply(); //Cant reply to the open email here. Some ambiguity..
item.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
}
}
}
}
catch (System.Exception e)
{
MessageBox.Show("An error occurred: " + e);
}
}
あなたはどんな問題がありますか? – BugFinder
なぜあなたが私たちに来たのか説明していないなら、あなたを助けることはできません。さて、あなたはそれを働かせることはできません。エラーが出ていますか?もしそうなら、彼らは何ですか?このコードはどうやって呼びますか?それは実際に何をしていますか? – Amy
ローカルドライブに保存されたメールに返信する必要があります。ドライブに保存されたメールに返信できる方法はありますか? Bascially、私の共有ドライブのフォルダをループして、正しい電子メールを取得して返信できるように検証しています。 app.Session.OpenSharedItem()メソッドを使用して電子メールを開いて表示することはできますが、item.Reply()は返信メールを開いていません。私は最初に述べたすべてのパラメータを渡す必要があります。 – Sneha