|
|
| |
Emailing a Datagrid |
| |
|
aspNetEmail makes it super simple and easy to email server controls.
aspNetEmail will render the control down to its HTML and then mail that content.
For more info on emailing controls, check out the help file here.
|
| |
|
The following example will email this datagrid pulled from the Pubs database. To send yourself this datagrid, simply enter your
mailserver address, 'From' email address, and 'To' email address below.
| au_id | au_lname | au_fname | phone | address | city | state | zip | contract |
| 172-32-1176 | White | Johnson | 408 496-7223 | 10932 Bigge Rd. | Menlo Park | CA | 94025 | true |
| 213-46-8915 | Green | Marjorie | 415 986-7020 | 309 63rd St. #411 | Oakland | CA | 94618 | true |
| 238-95-7766 | Carson | Cheryl | 415 548-7723 | 589 Darwin Ln. | Berkeley | CA | 94705 | true |
| 267-41-2394 | O'Leary | Michael | 408 286-2428 | 22 Cleveland Av. #14 | San Jose | CA | 95128 | true |
| 274-80-9391 | Straight | Dean | 415 834-2919 | 5420 College Av. | Oakland | CA | 94609 | true |
| 341-22-1782 | Smith | Meander | 913 843-0462 | 10 Mississippi Dr. | Lawrence | KS | 66044 | false |
| 409-56-7008 | Bennet | Abraham | 415 658-9932 | 6223 Bateman St. | Berkeley | CA | 94705 | true |
| 427-17-2319 | Dull | Ann | 415 836-7128 | 3410 Blonde St. | Palo Alto | CA | 94301 | true |
| 472-27-2349 | Gringlesby | Burt | 707 938-6445 | PO Box 792 | Covelo | CA | 95428 | true |
| 486-29-1786 | Locksley | Charlene | 415 585-4620 | 18 Broadway Av. | San Francisco | CA | 94130 | true |
|
|
|
 |
|
The box is not shipped.
aspNetEmail is a
downloadable product.
|
| |
|
|
Send yourself this datagrid
Simply enter your mail information below.
The code used to send this grid, can be found below
[C#]
EmailMessage msg = new EmailMessage( "mail.myCompany.com");
msg.FromAddress = "me@myCompany.com";
msg.To = "You@YourCompany.com";
msg.Subject = "Requested Data";
//build a datagrid
DataGrid dg = new DataGrid();
//have a method called GetDataTAble() that builds a datatable from a database.
dg.DataSource = GetDataTable();
dg.DataBind();
msg.Body = "Hi please review the following data.";
msg.AppendControlToBody( dg );
msg.Send()
[Visual Basic]
Dim msg As New EmailMessage("mail.myCompany.com")
msg.FromAddress = "me@myCompany.com"
msg.To = "You@YourCompany.com"
msg.Subject = "Requested Data"
'build a datagrid
Dim dg As New DataGrid()
'have a method called GetDataTAble() that builds a datatable from a database.
dg.DataSource = GetDataTable()
dg.DataBind()
msg.Body = "Hi please review the following data."
msg.AppendControlToBody(dg)
msg.Send()
|