Results 1 to 1 of 1
Thread: Trouble with a mailing list
Sep 22, 2004, 06:18 #1
- Join Date
- Apr 2004
- 0 Post(s)
- 0 Thread(s)
Trouble with a mailing list
I had an asp mailing list that sent a message to a text file of recipients, which worked beautifully until the powers that be upgraded servers on me and didn't tell me how my components would be effected. The original script used CDONTS, now replaced with Persits ASP Email.
Anyway, now that I've vented...
This code is now throwing an error:
last = Ubound(maillist) - 1 Response.Write "<PRE>Mail being sent ot subscribed members of " & Request.Form("filename") & vbCrlf Response.Write "using letter " & Request.Form("lfilename") & vbCrlf & vbCrlf for i = 0 to last singlemail = split(maillist(i), delimiter, -1, vbtextcompare) if mailpattern(singlemail(0)) then mailresult = SendMail(Request.Form("from"), singlemail(0), _ Request.Form("subject"), lettext, "", "", 1) if mailresult then Response.Write singlemail(0) & ": SENT" & vbCrlf else Response.Write singlemail(0) & ": MAIL NOT SENT" end if end if next
I did have to modify the SendMail function - but I can't tell where I caused the problem:
function SendMail (sFrom, sTo, sSubject, sBody) on error resume next dim myCDO set myCDO = Server.CreateObject("Persits.MailSender") myCDO.Host = "mx1.lemoyne.edu" if IsObject(myCDO) then myCDO.From = sFrom myCDO.AddAddress = sTo myCDO.Subject = sSubject myCDO.Body = sBody myCDO.Send set myCDO = nothing sendMail = True else SendMail = False end if on error goto 0 end Function