locked
MAPI 32 Throwing Error, while sending email."MAPISendEmail failed !. Generate MAPI failure [2] RRS feed

  • Question

  • Hi ,

    I am getting error when i am sending email using MAPI,

    not all machine getting this error only few, what could be reason.

    using same OS too, window XP

    Thanks

    A-


    Ashok


    • Edited by Jumpingboy Thursday, January 3, 2013 3:40 PM
    Thursday, January 3, 2013 3:37 PM

Answers

  • Thanks for reply.

    I made workable. below is code

    Outlook.

    Application objApp = null;

    Outlook.

    MailItem objMail = null;

    objApp =

    new Outlook.Application();

    objMail = (Outlook.

    MailItem)objApp.CreateItem(Outlook.OlItemType.olMailItem);

    objMail.Attachments.Add((

    object)fileAttachTextBox.Text,

    Outlook.

    OlAttachmentType.olEmbeddeditem, 1, (object)"Attachment");

    objMail.Attachments.Add((

    object)fileAttachTextBox.Text,

    Outlook.

    OlAttachmentType.olEmbeddeditem, 1, (object)"Attachment");

    objMail.To =

    "atest@test.com;

    objMail.Subject =

    "strSubject";

    objMail.Body =

    "strBody";

    objMail.Display(

    true);


    Ashok

    Monday, January 7, 2013 3:13 PM

All replies

  • Hi Ashok,

    Thanks for posting in the MSDN Forum.

    I will involve some experts into your thread to see whether they can help you, there might be some time delay, appreciate for your patience.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 4, 2013 2:43 AM
  • Thanks , let me give you more details.

    i did some debug and try to fix. below more details , may help to understand what problem.

    I have Window Application (WPF) , when i created test page and call from startup page  directly same code then working,

    but when i create another page which getting call from some other page failing. (like this page reside in subdirectory).

    but same thing woking for few users and faling for few users not able to find what could be reason.

    Thanks

    A-


    Ashok

    Friday, January 4, 2013 2:19 PM
  • Hi Ashok,

    It's based on my experience that WPF will be written via VB.NET or C#, and I never see somebody implement MAPI via VB.NET or C# directly. As usual, we will implement MAPI via C++. So would you please provide your code for further research?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Jumpingboy Monday, January 7, 2013 3:14 PM
    • Unmarked as answer by 许阳(无锡) Tuesday, January 8, 2013 1:17 AM
    Monday, January 7, 2013 2:15 AM
  • Thanks for reply.

    I made workable. below is code

    Outlook.

    Application objApp = null;

    Outlook.

    MailItem objMail = null;

    objApp =

    new Outlook.Application();

    objMail = (Outlook.

    MailItem)objApp.CreateItem(Outlook.OlItemType.olMailItem);

    objMail.Attachments.Add((

    object)fileAttachTextBox.Text,

    Outlook.

    OlAttachmentType.olEmbeddeditem, 1, (object)"Attachment");

    objMail.Attachments.Add((

    object)fileAttachTextBox.Text,

    Outlook.

    OlAttachmentType.olEmbeddeditem, 1, (object)"Attachment");

    objMail.To =

    "atest@test.com;

    objMail.Subject =

    "strSubject";

    objMail.Body =

    "strBody";

    objMail.Display(

    true);


    Ashok

    Monday, January 7, 2013 3:13 PM
  • Hi Ashok,

    I'm glad to hear you have solved it via yourself. Thanks for sharing your code here, it will very beneficial for other community members who have similar problem to see how you solved it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 8, 2013 1:18 AM