none
send email to email address in a textbox

    Question

  • how can I code a button in visual basic to open up the default mail application and send an email to an address in a textbox? I'm using Visual Studio 2012

    • Edited by mitchc22 Wednesday, February 1, 2017 10:48 PM
    Wednesday, February 1, 2017 10:46 PM

Answers

All replies

  • For example =>

     Dim Process As New Process()
     Process.StartInfo.FileName = "mailto:email@mail.com?subject=subject&body=body"
     Process.Start()
    Wednesday, February 1, 2017 11:30 PM
  • I have a database for contacts. One of the fields in that database is email addresses. What I would like to do is be able to click a button and the email address that is in the textbox populates the recipient address in the email application. 
    Thursday, February 2, 2017 1:23 AM
  • Just do :

    Process.StartInfo.FileName = "mailto:" + TextBox1.Text
    Thursday, February 2, 2017 1:37 AM
  • THANK YOU!!! I have been trying to find out how to do this for a while. This is my first project and have never done programing before so thank you.
    Thursday, February 2, 2017 1:43 AM
  • Hi friend,

    Glad that you've got an answer for your issue. And have fun in programming.

    If any reply has helped you resolved your issue please mark it as answer which could benefit other community members who are facing similar issues. Thanks for your understandings and supports.

    Best regards,

    Fletch


    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.

    • Marked as answer by mitchc22 Thursday, February 2, 2017 2:56 PM
    • Unmarked as answer by mitchc22 Thursday, February 2, 2017 2:56 PM
    Thursday, February 2, 2017 6:01 AM