The
only way to provide the user's GMail credentials would be to ask the user to enter them. Any user with an ounce of common sense wouldn't enter their GMail credentials on a random website, so I don't think that's going to work. :)
You need to provide the credentials of
your own GMail account. In order to send the message, you'll need to set
the Sender
property[
^] to your own email address.
mailmessage.From = new MailAddress(test.Text);
mailmessage.Sender = new MailAddress("Your-Address@gmail.com");
...
smtpclient.Credentials = new System.Net.NetworkCredential("Your-Address@gmail.com", "Your-Password");
Depending on the recipient's mail client, the message could be shown as
"From <your address> on behalf of <user's address>".