0

Currently Im trying to create an .eml file in C# with some information (shown below) that should be opened as a draft in Lotus Notes. The creation of the .eml works and contains the information I want to have. However the problem is, if I open this file in Lotus Notes, it is not shown as a draft, but like an E-Mail already sent. You cant edit the recipients. But thats what I want to have. The user should check the e-mail before being sent and should be able to change the recipients.

I did some research and found this thread, I tried the suggested workaround in the comments, but it did not work out. I didnt find any other information on this topic besides that thread.

Here is my sourcecode:

 private void CreateEMailTemplate()
    {
        MailMessage EMailTemplate = new MailMessage();

        EMailTemplate.Headers.Add("X-Unsent", "1");
        EMailTemplate.From = new MailAddress("test@test.com", "Testuser");
        EMailTemplate.To.Add("test@test.com");
        EMailTemplate.Subject =  "Create E-Mail Template";
        EMailTemplate.Body = "Body of the Template!";

        SmtpClient smptClient = new SmtpClient();
        smptClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
        smptClient.PickupDirectoryLocation = @"C:\Users\Test\Desktop\";
        smptClient.Send(EMailTemplate);

    }

I would be thankful for any advice or answer, if this is possible at all with Lotus Notes or if their is another way to do it. Thank you and have a nice weekend!

Community
  • 1
  • 1
RawMVC
  • 123
  • 1
  • 15
  • You are using .Net classes. Why not use the Lotus Notes API, as in (1) [Email : Viewing Lotus Notes E-Mail Before Sending](http://www.ozgrid.com/forum/showthread.php?t=18259) and in (2) [VBA/Lotus Notes: create a new memo without sending it](http://www.ozgrid.com/forum/showthread.php?t=172223) and in (3) [Create Email but don't Send - Lotus Notes](https://www.mrexcel.com/forum/excel-questions/73766-create-email-but-dont-send-lotus-notes.html). – Sam Hobbs Apr 22 '17 at 22:36
  • If the .Net classes will work then see (1) [c# - How to save MailMessage object to disk as *.eml or *.msg file - Stack Overflow](http://stackoverflow.com/questions/1264672/how-to-save-mailmessage-object-to-disk-as-eml-or-msg-file) and see (2) [Saving an email as "Draft" in the Drafts folder – Akash Blogging……](https://blogs.msdn.microsoft.com/akashb/2008/10/06/saving-an-email-as-draft-in-the-drafts-folder/). – Sam Hobbs Apr 22 '17 at 22:37
  • I don't have Notes but if I did and if it can be done then I would figure it out. One possibility is to use Notes to create a draft and save it. Another possibility is to just create a eml file as a plain text file; the format is standardized and relatively simple. – Sam Hobbs Apr 22 '17 at 22:41

1 Answers1

1

Since the person who asked the question in the other thread got nowhere with the suggestions I made in those comments, I suspect that there's simply no way to do this. I think you'll have to skip building the .eml file and just create the draft using the Domino Interop classes.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41