c# - How to prevent MS Outlook to send winmail.dat attached in a plain text email? -


i'm working web service has reply email customers if error happens or if data sent not in correct format. i'm using class mapimessage send mails maked "unread" in microsoft outlook account opened in computer runs service.

this code of method sends emails.

    private void enviarmail(string destinatarios, string cc, string bcc, string asunto, string texto, byte[] buffer, string nombrearchivo)     {         if (string.isnullorempty(destinatarios))             throw new argumentnullexception("destinatarios", "el destinatario de correo no puede estar vacío");          try         {             if (_mapi.openoutbox())             {                 mapimessage message = new mapimessage();                  if (message.create(_mapi, mapimessage.priority.importance_normal))                 {                     message.setsendername(settings.default.remitente);                     message.setsenderemail(settings.default.remitentecorreo);                     message.setsubject(asunto);                     message.setbody(texto);                      foreach(string destinatario in destinatarios.split(new char[] {';'}, stringsplitoptions.removeemptyentries))                         message.addrecipient(destinatario.trim());                      //some other code irrelevant question                       if (buffer != null)                     {                        //doesn't matter right                     }                      if (!message.send())                         throw new applicationexception("no pudo enviarse el correo electrónico.");                 }             }         }         catch         {             throw;         }     } 

like said before, mail has plain text, set last 2 parameters null in order specify method doesn't have attachment when reply message:

enviarmail(somecustomeremail, "", "", properties.resources.somesubject, somebodytext, null, ""); 

the fact email includes file winmail.dat , not want. how looks testing in gmail account: enter image description here


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -