473,383 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to email a datagrid

how to you email a datagrid as a html email message.

this is what i have

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

'Create MailMessage instance, set properties, and send

Dim Mail As New MailMessage

Dim sw As New System.IO.StringWriter

Dim hw As New System.Web.UI.HtmlTextWriter(sw)

Dim body As String

'Render DataGrid output as Html

EligInfo.RenderControl(hw)

'Dim dataGridHTML As String = hw.ToString()

Mail.To = "Dt*******@pmgscc.com"

Mail.Cc = ""

Mail.Bcc = ""

Mail.Subject = "Requested Eligibility Change"

'Mail.BodyFormat = MailFormat.Html

Mail.Body = sw.ToString

Mail.From = "Dt*******@pmgscc.com"

SmtpMail.SmtpServer = "Mailserver"

SmtpMail.Send(Mail)
Nov 18 '05 #1
1 1122
Hi Dave,
I'm reviewing this post and found that you provided some of your research
results and share it with others,yes? I think the solution you provided so
informative that it'll save a lot time for many others who're searching
for the similiar things. Thanks very much for posting here and sharing your
experience. In the meantime, if you have any questions or other opinions,
please always feel free to post here.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tarren | last post by:
Hi: I have an aspx page that takes a dataset, makes the datagrid, and displays it. The new thing I have to do is take this same output and send it as an email. Is there an easy way to do...
3
by: kieran | last post by:
Hi, i know this should be easy but cant get it exactly right. i have a Datagrid pulling results from a stored proc in database, it outputs four columns, one of which is an email address...
5
by: sam | last post by:
Do anyone know how to apply send datagrid via email? Any website for reference? Please advise.
5
by: tshad | last post by:
Is there a way to easily put a Datagrid in an email? I want to send a select result in the form of a Datagrid via an email to some of our clients. Thanks, Tom
0
by: mattmerc | last post by:
Hi all, I recently posted a question similar to this, but now I have a different need than what I had anticipated. Thanks all for your help so far. Here is what I am looking for: I have an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.