Solved

How can i send data grid content to email using asp.net?

Posted on 2008-10-03
4
167 Views
Last Modified: 2012-05-05
may i know How can i send data grid content to email using asp.net?

the simplest way...
0
Comment
Question by:kengkit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 21

Expert Comment

by:silemone
ID: 22635611
you have to iterate through grid rows and add them as the content of your email...
0
 

Author Comment

by:kengkit
ID: 22636143
ermm.. any code provide?

The following is what i using to send email:

    Private Function sendmail()

        Dim content As String

        content = "Hello"

        Dim myMessage As New MailMessage
        Dim myMail As SmtpMail
        myMessage.From = "admin@abc.com"
        myMessage.To = Me.txt_email.Text
        myMessage.Subject = "Welcome to My Home "
        myMessage.Body = content

        myMail.SmtpServer = "210.48.217.15"
        myMail.Send(myMessage)


    End Function
0
 
LVL 21

Accepted Solution

by:
silemone earned 25 total points
ID: 22636469
well what i would do first of all is use a stringBuilder to build my content...so content would be a stringbuilder...

So upon iterating through the cells of the grid, I would add needed data to StringBuilder and then I would

make myMessage.Body = stringBuilderName.ToString()...
0
 
LVL 21

Expert Comment

by:silemone
ID: 22636480
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question