mail cannot be sent

Last post 07-04-2009, 4:32 AM by saqib.razzaq. 1 replies.
Sort Posts: Previous Next
  •  07-01-2009, 2:24 PM 186471

    mail cannot be sent

    Attachment: Present (inaccessible)
    Hi, looking for a tool to pre-generate mails in ".msg" format as well as ".eml".
    It was possible to generate a "msg" (draft) with
    attachments and text just like I would have done everything in my outlook manuallySo far so good! My problem is now, after completion and pressing the "send-Button" outlook shows an errormessage (=This element can not be sent. Error while executing the operation). I found one helpful workaround described in a similar case in the forum, which doesn't work unfortunately.

    I use Windows Server 2003 (32), Microsoft Exchange 2003 as Mail server and 3.5 of
    .NET framework and Aspose.Network. Here is the code that creates my file (see attachments!):

    MailMessage mailMessage = new Aspose.Network.Mail.MailMessage();
    MapiMessage outlookMsg = MapiMessage.FromMailMessage(mailMessage, OutlookMessageFormat.ASCII);
    outlookMsg.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT | MapiMessageFlags.MSGFLAG_FROMME);
    outlookMsg.SetStringPropertyValue(MapiPropertyTag.PR_SENDER_EMAIL_ADDRESS, "");
    outlookMsg.SetStringPropertyValue(MapiPropertyTag.PR_SENDER_NAME, "");
    outlookMsg.SetStringPropertyValue(MapiPropertyTag.PR_SENT_REPRESENTING_EMAIL_ADDRESS, "");
    outlookMsg.SetStringPropertyValue(MapiPropertyTag.PR_SENT_REPRESENTING_NAME, "");
    mailMessage.Subject = "myMailSubject";
    mailMessage.TextBody = "myMailBody";
    mailMessage.AddAttachment(new Mail.Attachment(@"c:\temp\test.pdf")); //simple (existing) file
    mailMessage.AddAttachment(new Mail.Attachment(@"c:\temp\test.doc")); //simple (existing) file!
    outlookMsg.Save(@"c:\temp\draftMail.msg");

    I attach the
    generated "draftMail.msg" and a screen shot of it shown in outlook and the error message of outlook after "Send" is pressed. How can the mail be sent?
    Thanks for your help
    Sam
     
  •  07-04-2009, 4:32 AM 186872 in reply to 186471

    Re: mail cannot be sent .NET

    Hi Sam,

    Thanks for considering Aspose.

    This problem sometimes occur when you use Microsoft Exchange Server as a mail server. We will look into it and will get back to you soon.


    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
View as RSS news feed in XML