Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Help!! email newsletter from XML file

Reply
Thread Tools

Help!! email newsletter from XML file

 
 
slinky
Guest
Posts: n/a
 
      02-14-2008
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'm hoping to find some Javascript that will iterate through my XML
file and send abtout 100 emails out automatically to those wanting my
newsletter. I've tried to do this in ASP.net/VB.net but am stumped so
I thought I'd look at the Javascript possibilities.

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 vb.net/asp.net 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>

 
Reply With Quote
 
 
 
 
Bart Van der Donck
Guest
Posts: n/a
 
      02-15-2008
slinky wrote:

> I'm hoping to find some Javascript that will iterate through my XML
> file and send abtout 100 emails out automatically to those wanting my
> newsletter. I've tried to do this in ASP.net/VB.net but am stumped so
> I thought I'd look at the Javascript possibilities.


Client-site javascript could parse the XML-file, but cannot
automatically send emails.

The usual way is to make a server-side application like this:

1. Read XML-file into memory
2. Parse the DOM or tie to variables
3. Loop for every entry
4. Send out the mail for each entry in the loop
5. Print report to screen

Hope this helps,

--
Bart
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
email-newsletter bardeban Computer Support 6 11-20-2007 08:06 AM
Insert an HTML newsletter in the body of an email johnny15 HTML 3 05-18-2007 10:21 AM
SMTP EMAIL: Inviare una newsletter ad un gruppo di iscritti and251076@hotmail.com ASP .Net 0 09-01-2005 07:42 AM
Creating an email newsletter Chuck HTML 3 08-05-2004 06:18 PM
Need for Email Newsletter System AF HTML 1 05-06-2004 07:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57