Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 13 Feb 2008 21:55:24 -0800 (PST),    group: microsoft.public.dotnet.academic        back       


emailing newsletter from XML recipient list   
Thanks in advance for for any clues: I have a website I'm building
using MS-Visual Web Developer Express (Asp.Net/VB.net). I'm tooling
it
to collect names and emails to send out our newsletter. I have
successfully setup an XML file with some sample names and emails. I
populated this through a well functioning .aspx page that writes to
the XML file and I have set up another .aspx page from which I can
view the collected persons. what I need is a way to send our
newsletter (which for the time being will be just some text in the
email body (but I'd like to do more). So I need to parse through the
XML list and send an email to each recipient. Any clues?

Here's my code for users entering their names and email addresses:


<script runat="server">
    Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            Using ds As New DataSet()
                ds.ReadXml(Server.MapPath("emailList.xml"))
                txtNewEvent.DataBind()
                txtDate.DataBind()
            End Using
        End If
    End Sub


    Private Sub btnSubmit_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnSubmit.Click
        Using ds As New DataSet()
            ds.ReadXml(Server.MapPath("emailList.xml"))
            Dim dr As DataRow = ds.Tables(0).NewRow()
            dr("emailAddress") = txtNewEvent.Text
            dr("name") = txtDate.Text
            ds.Tables(0).Rows.Add(dr)
            ds.WriteXml(Server.MapPath("emailList.xml"))
        End Using
    End Sub
</script>


Here's my code for viewing the list of emails:


<script runat="server">
    Private Function MakeDataView() as DataView
        Dim myDataSet As New DataSet()
        myDataSet.ReadXml(Server.MapPath("emailList.xml"))
        Dim view As DataView = New DataView(myDataSet.Tables(0))
        view.AllowDelete = False
        view.AllowEdit = False
        view.AllowNew = False
        view.Sort = "Name ASC"
        Return view
    End Function


    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim view as DataView = MakeDataView()
        dgEmail.DataSource = view
        dgEmail.AllowSorting = True
        dgEmail.DataBind()
    End Sub
</script>


Thanks!!!
date: Wed, 13 Feb 2008 21:55:24 -0800 (PST)   author:   slinky

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us