Knowledgebase
How can I send mail to people in a database via your servers/how do I send mail via ASPQmail?
Posted by Phil Parry on 18 September 2007 03:31 PM
If you need to send mail to a lot of people you can do it programatically via ASPQmail. An example script is below:

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.QMessage = true

' Use the line below to configure your mail to be sent at a later time
' Mailer.QTime = "07/30/00 22:10:00"

Mailer.FromName = "Joe?s Widgets Corp."
Mailer.FromAddress= "Joe@somehost.com"
Mailer.RemoteHost = "relay.hostinguk.net"
Mailer.AddRecipient "John Smith", "jsmith@anotherhostname.com"
Mailer.Subject = "Great SMTP Product!"
Mailer.BodyText = "Dear Stephen" & VbCrLf & "Your widgets order has been processed!"
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if

For more information see:

http://www.serverobjects.com/comp/aspmail3.htm

http://www.serverobjects.com/comp/AspQmail.htm

Please note that you MUST send mail via relay.hostinguk.net - do NOT attempt to send mail through our other mail servers as they are configured to automatically blacklist anyone who sends 1000 messages or more in 24 hours, which will prevent you sending further e-mail.
(960 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).