473,804 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Using ds As New DataSet()
ds.ReadXml(Serv er.MapPath("ema ilList.xml"))
txtNewEvent.Dat aBind()
txtDate.DataBin d()
End Using
End If
End Sub
Private Sub btnSubmit_Click (ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles btnSubmit.Click
Using ds As New DataSet()
ds.ReadXml(Serv er.MapPath("ema ilList.xml"))
Dim dr As DataRow = ds.Tables(0).Ne wRow()
dr("emailAddres s") = txtNewEvent.Tex t
dr("name") = txtDate.Text
ds.Tables(0).Ro ws.Add(dr)
ds.WriteXml(Ser ver.MapPath("em ailList.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.ReadX ml(Server.MapPa th("emailList.x ml"))
Dim view As DataView = New DataView(myData Set.Tables(0))
view.AllowDelet e = 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.DataSou rce = view
dgEmail.AllowSo rting = True
dgEmail.DataBin d()
End Sub
</script>

Feb 14 '08 #1
1 1704
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
1759
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 place it....Should I begin a whole new set of ASP commands or should I incorporate it into the current ASP that specifies an email being sent? EMAIL BEING SENT *** <%
7
1904
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 :-) By the way, please don't reply just to tell me that my code isn't optimized and that I should use a delimited database rather than a line by line record. If I had my way, I'd do it differently too.
2
2967
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 some configuration problem in my IIS setup? Thanks,
1
999
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
1137
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 newsletter(embedded into the mail) and NOT as an attachment. Please any ideas with this would be greatly appreicated! Thanks, MGR
1
1671
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 tried to use the msgMail.ToString() method but this won't help, or i have to type cast te MailMessage as a string, but i donýt know how to do this. Thanks, Marc
4
4227
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 http://www.phptutorial.info/scripts/mailinglist/) which allow user to subscribe and unsubscribe. If user selects subscribe, enter an email and that email is already in the emaillist.txt, a message is sent to that email saying thank you you've already subscribed. ...
2
1400
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 latter led me to think that there might be a way to achieve significant size reduction, while having file that can be read using C. So, do you know any way to write the file so as to get a similar size reduction while being able to read its...
2
1932
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 need help in handling File type (Upload button). Thank you very much inadvance. reg JAI
0
9591
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9166
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7631
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.