473,387 Members | 1,742 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,387 software developers and data experts.

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="VBSCRIPT"%>

<% option explicit %>

<%

server.ScriptTimeout=300

response.buffer = true

dim newsletter, arrEmail, i, addresslist, pCount

newsletter = request.form("newsletter")

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

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

pcount = request.QueryString("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(strSQL)

arrEmail = RS.getrows

%>
<%

RS.close

set RS = nothing

conn.close

set conn = nothing

%>

<%

sub sendMail

Set objMail = Server.CreateObject("Persits.MailSender")

If pCount = 1 Then

for i = 0 to 500

'addresslist =

objMail.Host = "Mail.stevenscaife.co.uk"

objmail.From = "ma*********@finka.co.uk"

objmail.fromname = "ma*********@finka.co.uk"

objMail.addaddress 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_newsletter.asp?pCount=2">

<%

Else

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

'addresslist =

objMail.Host = "Mail.stevenscaife.co.uk"

objmail.From = "ma*********@finka.co.uk"

objmail.fromname = "ma*********@finka.co.uk"

objMail.addaddress 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 1338

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

Similar topics

2
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...
1
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...
5
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...
2
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...
4
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...
0
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...
4
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
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...

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.