Unable to create a new mail with multiple recipients with mailto uri

萝らか妹 提交于 2019-12-05 10:14:44
Jonatha ANTOINE

There is a hack, using the HyperLinkButton (sorry, this is a dirty hack) :

  1. Load an hyperlinkbutton using a XAmlReader,
  2. Retrieve its AutomationPeer,
  3. Launch a click

      var uriString = "mailto:username@mail.com,username2@mail.com";
      string xamlString = "<HyperlinkButton "
         + "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" " 
         + "NavigateUri=\"" + uriString + "\"/>";
      var c = (HyperlinkButton)XamlReader.Load(xamlString);
      new HyperlinkButtonAutomationPeer(c).Invoke();
    

Try adding 2 forward slashes after the hostname like this : mailto://

cant you follow this code?

  System.Net.Mail.MailMessage email = new System.Net.Mail.MailMessage();

  email.To.Add("abcd@mail.com");
  email.CC.add("abcd1@mail.com");
  email.CC.add("abcd2@mail.com");
  email.CC.add("abcd2@mail.com");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!