473,397 Members | 2,099 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,397 software developers and data experts.

Help!! email newsletter from XML file

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>

Feb 14 '08 #1
1 1677
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
Feb 15 '08 #2

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

Similar topics

2
by: dmiller23462 | last post by:
I would like to append to a file, AS WELL AS, send an email via ASP....I have some sample code from ASP101.com and am planning on modifying it to my uses but I don't know where exactly I should...
7
by: Shane | last post by:
Hi, Thanks in advance for the help. I have been to many websites and tried several solutions to my problem, but have fixed part of it. It's time to come humbly to the newsgroups for help :-) ...
2
by: Bruce Russell | last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the solution explorer. The file is located in my local web server at C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx Is there...
1
by: Max Bialystock | last post by:
Is it possible to take the first file in a folder (as sorted by name), email it to someone, then move the file to a separate directory? Any help at all will be much appreciated. Thanks, Max
0
by: MGRIDEOUT | last post by:
Hello, I have am webpage created (very simple using HTML), it contains a few lhpyerinks to other pages. However, I am having trouble finding a way to create this webpage so I may mail it out as a...
1
by: Marc Hoeijmans | last post by:
Hi, We like to save the emails we send as textfile on a file server. I want to use the System. Web.Mail class for sending the email. The question is how can i save the message as file. I have...
4
by: maxtran2005 | last post by:
Hi guys, I've downloaded couple email list scripts at hotscripts but none of them do what I wanted. Can you help me? Basically, I have an emaillist.txt (code from this site...
2
by: pedro.ballester | last post by:
Hi everyone, One of my C programs produces a huge ascii file containing float, integers and characteres with a given structure. The file is 6.5GB which can be reduced to 569MB once zipped. The...
2
by: pandurusankar | last post by:
Hi, Need a pointer for managing File type button in HTML page, i am able to handle all the components in HTML using IEAutomation module like: text box, links, radio button, list box etc. but i...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.