Link to home
Start Free TrialLog in
Avatar of mindserve
mindserve

asked on

email address in textbox to open in address in default email client in vb2005

How do I get the address from the textbox  txtcustomeremail.text to appear in the address of the email client.????

=======================================

Private Sub BTNEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNEmail.Click
        Dim theStringBuilder As New System.Text.StringBuilder()
        ' theStringBuilder.Append("mailto:your@emailAddress.com") ' & txtcustomeremail.text
        theStringBuilder.Append("mailto: & txtcustomeremail.text") ' & txtcustomeremail.text
        'TODO: Get the email address from txtcustomeremail.text to appear in the Mailto:
        ' theStringBuilder.Append("?subject=Salon Information")
        ' theStringBuilder.Append("&body=A Reminder")

        System.Diagnostics.Process.Start(theStringBuilder.ToString())

    End Sub
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You want to access the .text property, so don't put it inside the string literal...
SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mindserve
mindserve

ASKER

Fernando had it right, the other code didn't  do it since it was missing the System.Diagnostics.Process.Start(theStringBuilder.ToString()) line of code.
Thanks!
No ...  My code showed where the error lay.  I didn't bother copying the code you had correct already.

Fernando's comment is a copy of mine, except he also copied the code that was correct from your comment.
Sorry, Paul , you are correct both answers were right.
No big deal.  But I guess I thought that FernandoSoto has been around long enough to know not to come in 15 minutes later and post the same code.  Especially on something so simple.
Sorry PaulHews; but I wanted to be as precise as possible so that mindserve would know exactly what was needed to make her code work. I try not to assume the level of the authors ability in there attempt to master there trade so that they may correct there issue as fast as possible.
Glad I was able to be of some help mindserve, have a great day. ;=)
FernandoSoto:
It's great to come into a question and suggest an improvement.  In the 7+ years I've been at EE, I've done it many times.  But I try to do it the right way--to acknowledge what the other person has written, and suggest that there can be improvements.

See
https://www.experts-exchange.com/help.jsp#hi242
Especially the part in bold.

I'm not saying this to be mean or critical.  But I'm not shy about letting people know that I would like to be treated with the same respect that I treat others.  I believe that EE is a community, and that people in that community have to have a standard of behaviour.  That goes double for experts of your standing.
This was my fault. Paul gave the correct answer the first time, but I did not read through it carefully enough to realize what changes he had made to the code. Sorry guys...
Hello PaulHews;

I just took mindserve code, see original post, corrected the syntax problem with the one statement and removed all the statements that were commented out and reposted mindserve code so that it would work. By removing all comments and taking the time to show the code complete helps in understanding the problem. If you would have posted some clever way in solving a problem and I would have built upon it I would have mention you by name as I have done many times in the past here at EE.
Sorry for the off topic discussion mindserve.
Yes mindserve, please accept my apologies and please do not feel like it was anything to do with the way the question was asked.

Have a great day to all.

BTW mindserve, you can place a zero point question at the support link at
https://www.experts-exchange.com/support.jsp and have the question re-opened to have the point split if you like, I would have no objection to that at all.
Thanks folks.
Thank you.