Sending mail with JMail question

B

blair

Hi:

I'm trying to send a message using JMail with the following ASP code
(using ADO to connect to MS Access database). :
____________________________________________

Set objRS1 = strConnect1.Execute(strSQL1)

Dim msg, varRecipient

Set msg = Server.CreateObject("JMail.Message")
msg.logging = true

msg.From = varEmail
msg.FromName = varName

While Not objRS1.EOF
msg.addRecipient objRS1.Fields("StudentEmail")
objRS1.MoveNext
Wend

msg.Subject = varSubject
msg.Body = varMessage

msg.Send ("mail.myemailserver.com")
Set msg = nothing

_________________________________

The code gives an error saying the server did not receive the message,
or sometimes it goes through but the email is not sent. I did a
response.write in the loop just to test it was getting the email
addresses all right from the database and it was. Any idea what is
wrong? BTW, I am not spamming, this is a newsletter for people who
signed up for said newsletter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top