none
System.Diagnostics.Process.Start with mailto not working

    Question

  • I have a datagridview with contacts data, including email address.

    When the user clicks the email cell, if it contains a valid email address, my program calls 

    System.Diagnostics.Process.Start("mailto:Cell.Value.ToString"). 

    It used to produce a new default email client window with the CellValidEmailAddress in the "to:" field 

    Now it opens a new window of the default internet browser with a "new tab" tab.

    I don't understand why the change, nor have I found a way to go back to the expected new default email client window.

    Could you help me here?

    Thank you


    Friday, December 16, 2016 5:49 PM

All replies

  • System.Diagnostics.Process.Start("mailto:" + Cell.Value.ToString())
    Friday, December 16, 2016 8:09 PM
  • Hi SergioTorres,

    Welcome to the MSDN forum.

    What's your project type? Does your issue is solved or not? You can have a try with Wyck's method, and check if works as your expected or not.

    If you are already solved, could you please share your solution and mark it as answer, that will help other community members who have the same or similar issue to easier search this useful solution, thank you for your support.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 19, 2016 1:45 AM
    Moderator
  • My bad, Wyck. This is how the method is actually called:

    System.Diagnostics.Process.Start("mailto:" + Contacts.CurrentRow.Cells("EMail").Value.ToString)

    Sara, the project is a Windows Forms Application targeting .net framework 4.6.

    My development pc is running Windows 10 Pro Version 10.0.14393 Build 14393

    I am using Visual Studio 2015 Version 14.0.25431.01 Update 3 to develop.

    I have my application installed in another PC, also running Windows 10, at my client's office and I asked them to try to click any email cell and it works fine for them: the pc's default email client opens with the To: field filled with the expected email address.

    I haven't changed the email sending code after I installed the application at my client's office. I became aware of the problem while testing other part of the code.

    Could it be that my PC has not defined the default email client?

    Nota Bene: the alert seems not to be working. I did not receive an alert for your answers. I came here because I had not received any alert.

    Monday, December 19, 2016 8:32 PM
  • That was the problem!

    My Development PC had Google's Chrome as the default application to handle email. How did that got set, I have no idea.

    I changed it to MS Outlook and now my application is calling outlook to send the email.

    Thank you all for your help.

    Monday, December 19, 2016 8:46 PM
  • Hi SergioTorres,

    I'm so glad to hear that your issue is solved and thank you for sharing.

    BTW, could you please mark it as answer, that will help other community members who have the same or similar issue to easier search this useful solution, thank you for your support.

    Best regards,

    Sara


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 20, 2016 1:31 AM
    Moderator