Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 28th, 2005, 03:18 PM
phase1media phase1media is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 3 phase1media User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 15 sec
Reputation Power: 0
Help! JMail coding problem

Hi - I've got the following code that grabs email addys from a ms sql 7 db, but it seems to send 2 emails to everyone on the list - can anyone tell me why, or what I need to do to fix it?

[Code (written in ASP)]:

<%
On Error Resume Next

'grab the variables from the form
strSubject = Request.Form("subject")
strBody = Request.Form("body")




'give us 10 minutes for the script to complete running
server.scripttimeout = 600000000

'function to open database

set DataConn = server.createobject("adodb.connection")

' Create the record set
set rs = server.CreateObject("adodb.recordset")

' Open the connection using our ODBC file DSN
DataConn.open "DSN"


SQL = "execute sp_SendCNewsletter"
set rs = DataConn.execute(SQL)

WHILE not rs.eof

Recipient = rs("EmailAddress")


Set objMail = Server.CreateObject("JMail.SMTPMail")
objMail.ServerAddress="formmail.strongsecure.com"
objMail.Sender = "me@mydomain.com"
objMail.Subject = strSubject
objMail.AddRecipient Recipient
objMail.Body = "Dear "&rs("FirstName")&"," & vbCrLF & vbCrLF & strBody & vbCrLF & vbCrLF & "http://www.mydomain.com - http://www.mydomain.com" & vbCrLF & vbCrLF &vbCrLF & "To remove your email address from this list, please click on the link below." & vbCrLF & "http://mydomain.com?EmailAddress="&rs("idPerson")
objMail.Execute

rs.movenext
WEND
Response.write("Newsletter has been Sent")
set objMail = nothing
rs.close
set rs = nothing



%>

[/code]

It connects to the db, sends emails, and writes that the emails have been sent, but it seems everyone gets 2 of them.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Help! JMail coding problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway