This is a migrated thread and some comments may be shown as answers.

[Solved] email from gridbuttoncolumn

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carina
Top achievements
Rank 1
Carina asked on 14 Mar 2013, 04:59 PM
Hello,

So I have a radgrid, and in this radgrid I have a "User" column, and and "Email" column.
The "Email" column is a gridbuttoncolumn.
I want to have that link button to email the selected user on that row when clicked.
Is this possible? I am a beginner, and I am working in vb.net

PLEASE HELP!

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Mar 2013, 05:12 AM
HI,

Tty the following code.
C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
 if(e.CommandName=="SendMail")
 {
  string from = "sender@example.com";
  string to = "recipient@example.com";
  string subject = "Your subject";
  string body = "some text";
  SmtpMail.SmtpServer = "mail.example.com";
  SmtpMail.Send(from, to, subject, body);
 }
}

Thanks,
Shinu
Tags
Grid
Asked by
Carina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or