예제 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            Vocabulary vocab = getSelectedVocabulary();
            if (vocab != null)
            {
                EmailPrompt ep = new EmailPrompt();
                if (ep.ShowDialog() == DialogResult.OK)
                {
                    if (!Directory.Exists(Data.tmpFolder))
                    {
                        Directory.CreateDirectory(Data.tmpFolder);
                    }
                    string[] files = Directory.GetFiles(Data.tmpFolder);
                    foreach (string file in files)
                    {
                        File.Delete(file);
                    }

                    string xml = Vocabulary.vocabToXml(vocab);
                    string _file = Data.tmpFolder + vocab.name + ".xml";
                    File.WriteAllText(_file, xml);

                    MapiMailMessage message = new MapiMailMessage("Ich teile ein Vokabular mit dir: " + vocab.name, "Speichere den Anhang, wähle \"Importieren\" im Vokabular-Trainer und wähle den gespeicherten Anhang aus!");
                    message.Recipients.Add(ep.email);
                    message.Files.Add(_file);
                    message.ShowDialog();

                    /*string args = "?subject=" + "Ich teile ein Vokabular mit dir: " + vocab.name
                        + "&body=" + "Speichere den Anhang, wähle \"Importieren\" im Vokabular-Trainer und wähle den gespeicherten Anhang aus!"
                        + "&Attach=\"" + Data.tmpFolder + vocab.name + ".xml\""
                       ;
                    MessageBox.Show(args);

                    System.Diagnostics.Process.Start("mailto:" + ep.email + args);*/
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Adds a new recipient with the specified address, display name and recipient type to this collection.
 /// </summary>
 public void Add(string address, string displayName, MapiMailMessage.RecipientType recipientType)
 {
     this.Add(new Recipient(address, displayName, recipientType));
 }
예제 #3
0
 /// <summary>
 /// Adds a new recipient with the specified address and recipient type to this collection.
 /// </summary>
 public void Add(string address, MapiMailMessage.RecipientType recipientType)
 {
     this.Add(new Recipient(address, recipientType));
 }
예제 #4
0
 /// <summary>
 /// Creates a new recipient with the specified address, display name and recipient type.
 /// </summary>
 public Recipient(string address, string displayName, MapiMailMessage.RecipientType recipientType)
 {
     Address = address;
     DisplayName = displayName;
     RecipientType = recipientType;
 }
예제 #5
0
 /// <summary>
 /// Creates a new recipient with the specified address and recipient type.
 /// </summary>
 public Recipient(string address, MapiMailMessage.RecipientType recipientType)
 {
     Address = address;
     RecipientType = recipientType;
 }