473,666 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with emailing code

There seems to be a problem with my emailing code, although during testing
it worked fine. What happens is it sends two emails instead of one, and
also doesn't put any text in the email for some addresses. Its sent as
plain text and as i said when i tested it to 6 email addresses it worked
fine.

my code is below

<%@LANGUAGE="VB SCRIPT"%>

<% option explicit %>

<%

server.ScriptTi meout=300

response.buffer = true

dim newsletter, arrEmail, i, addresslist, pCount

newsletter = request.form("n ewsletter")

newsletter = replace(newslet ter, "'", "''")

newsletter = replace(newslet ter, """", chr(34))

pcount = request.QuerySt ring("pCount")

%>

<!--#include file="includes\ connection.inc"-->

<%

'create the variables for the email to myself

dim objMail, MailMsg

'dimension the variables and set them

%>

<%

strSQL = "SELECT Email_Address FROM Mailing;"

set RS = conn.execute(st rSQL)

arrEmail = RS.getrows

%>
<%

RS.close

set RS = nothing

conn.close

set conn = nothing

%>

<%

sub sendMail

Set objMail = Server.CreateOb ject("Persits.M ailSender")

If pCount = 1 Then

for i = 0 to 500

'addresslist =

objMail.Host = "Mail.stevensca ife.co.uk"

objmail.From = "ma*********@fi nka.co.uk"

objmail.fromnam e = "ma*********@fi nka.co.uk"

objMail.addaddr ess arrEmail(0, i)

objMail.subject = "FINKA Newsletter"

objMail.isHTML = False

objMail.Body = newsletter

ObjMail.send

objMail.reset

next

'send emails

Set objMail = nothing

%>

<meta HTTP-EQUIV="refresh" content="0;url= process_newslet ter.asp?pCount= 2">

<%

Else

for i = 501 to ubound(arrEmail , 2) '501

'addresslist =

objMail.Host = "Mail.stevensca ife.co.uk"

objmail.From = "ma*********@fi nka.co.uk"

objmail.fromnam e = "ma*********@fi nka.co.uk"

objMail.addaddr ess arrEmail(0, i)

objMail.subject = "FINKA Newsletter"

objMail.isHTML = False

objMail.Body = newsletter

ObjMail.send

objMail.reset

next

'send emails

Set objMail = nothing

end if

response.write "<p class='maintext '>Emails have been sent</p>"

end sub

%>

And I call the sub in the body of my page, can anyone see anything wrong
with it that could cause it to not send text and to send to the email
address twice. The mailing list is approx 860 people long.

TIA


Jul 21 '05 #1
0 1368

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

Similar topics

2
1907
by: Paul Hudson | last post by:
Ive developed a web based system where somebody can add a news record using ASP and MS Access database connectivity. The new record is inserted into the database and then a formatted email gets send to a list of about 30 email addresses using CDONTS. My emailing ASP script works by looping through a recordset containing the email addresses, the text gets formatted, and then it sends, then moves onto the next recipient etc etc ... I...
1
1788
by: Stanley Cheung | last post by:
Hi all, I am developing the application for send emailing list, actually, i can perform to send a email 1 by 1 and do it on aspx page. I have a enquiry that how can the application change to background task instead of user need to wait and wait until all email sent. Also, when user waiting to complete the emailing list, the page is blank and nothing, can we put a layout when user waiting a request.
5
7373
by: Colin Anderson | last post by:
I discovered, with great excitement, this article http://www.davison.uk.net/vb2notes.asp when researching methods for emailing from Access via Notes. Unfortunatly, when I run this I get a Run-time error. When I run it on an XP machine it crashes, but on an NT box it just generates an unknown error, handled by the error handler. I have debugged and stepped through the code and have narrowed the issue to the point at which the...
2
1501
by: Wayne | last post by:
I am experiencing an intermittent problem when emailing snapshot reports using Sendobject. Outlook opens with the snapshot of the report attached but when I click the "Send" button on the Outlook toolbar it only works intermittently ie. sometimes the email is sent and others nothing happens. Using File/Send on the Outlook menu bar also works intermittently. However if I use the keyboard shortcut: Ctrl + Enter it works every time and the...
4
1650
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI currently for our client/server apps.
0
1067
by: Mike Grace | last post by:
Hi, I am writing a web site which sends order confirmations to users via email. Two changes that are needed are as follows: 1) PDF files are going to be attached to the email. It could be one, it could be 20! I have written the code to attach any number of PDF files to the
4
1550
by: number1.email | last post by:
I have tried the following code: FileName: index2.php --------------------------------- <? mail( "aaa@yahoo.com", "A", "B", "From: a...@aol.com" ); echo "Finished Emailing."; ?>
10
1675
by: paul814 | last post by:
I am having a bit of a problem with some code....can someone give me some suggestions? Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\production \date2.php on line 28 line 28 is this line: while($row = mysql_fetch_array(mysql_query($sql)) { It is the first while..
1
3263
by: =?Utf-8?B?U2FpIFZhamph?= | last post by:
Hi I am trying to send a .pdf document as an email attachment using net.mail. This email is being sent by a windows service application. After i receive the email, and when i try to open the attachment, i get the following error message... "adobe reader could not open <filenamebecuase it is either not a suppported file type or because the file has been damaged(for example, it was sent as an email attachment and wasn't correctly...
0
8438
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
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
8549
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
7376
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...
0
5660
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
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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
2
1761
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.