มีคำถามครับ เรื่องการดึงค่า Email Account จาก Mail client สำหรับ C#
ตอนนี้ ผมพัฒนาโปรแกรมด้วยภาษา C# ต้องการดึง Email Account List ตอนนี้ผมลองใช้ dll ของ MAPI.dll แต่มัน Default ให้ได้แค่ Outlook แต่ผมต้องการทำให้มันสามารถแสดงได้ ทั้ง Outlook หรือ Thunderbird ซึ่ง 2 ส่วนนี้จะมีการ set account ไว้
ตัวอย่างการใช้ MAPI.dll
if (NetMAPI.Init())
{
NetMAPI mapi = new NetMAPI();
if (mapi.Login())
{
StringBuilder strText = new StringBuilder();
if (mapi.GetProfileName(strText)) Console.WriteLine("Profile Name: " + strText); // return default outlook
if (mapi.GetProfileEmail(strText)) Console.WriteLine("Profile Email: " + strText);
if (mapi.OpenMessageStore())
{
// uncomment the functions you're interested in and/or step through these to see how each thing works.
}
mapi.Logout();
}
NetMAPI.Term();
}
อ้างอิงจากเว็บ http://www.codeproject.com/KB/IP/CMapiEx.aspx?msg=2833021
ปล. เพิ่งหัดเขียนโปรแกรม C#
ลองดูฮะ
kurosame Thu, 03/11/2011 - 18:01
ลองดูฮะ http://kb.mozillazine.org/MAPI_Support
อันนี้ผม ลองดู
qoo00456 Thu, 03/11/2011 - 18:35
In reply to ลองดูฮะ by kurosame
อันนี้ผม ลองดู แล้วครับไม่เข้าใจมัน เหมือนให้มัน set ค่า Thunderbird ให้มันเป็น default ของเครื่อง แล้วโปรแกรมมันจะสามารถ ดึงออกมาได้ แต่ถ้ากรณี เราไม่กำหนด เราสามารถ เลือกได้จากโปรแกรมเลยอ่ะครับว่าจะให้ get จาก อะไร ครับผม ยังไง ก็ขอบคุณมากครับ พอดีมือใหม่ภาษานี่้เช่นกันครับ ถ้าผมเข้าใจผิดยังไง โปรดช่วย ชี้แจงด้วยครับ