Forums
This topic is locked
Send Newsletter via Jmail
Posted 19 Mar 2003 03:13:04
1
has voted
19 Mar 2003 03:13:04 Sven Hentschel posted:
Hello,I have an ASP script that that sends out an email to mutltiple users via a database.
I enter my "newsletter" information into the form and press submit. found here:
www.linksouls.com/database/newslettercreate.htm
The form points to the page:
www.linksouls.com/database/newslettercreate.asp
This page runs the script. with sends the form info to all my members and loops till .EOF.
The problem is that the script does not seem to be sending any mail. do not get any errors and as far as I can tell the script looks fine.
this what the code looks like :.
--------------------------------------------------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/newletter.asp" -->
<%
Dim rsEmailAddress
Dim rsEmailAddress_numRows
Set rsEmailAddress = Server.CreateObject("ADODB.Recordset"
rsEmailAddress.ActiveConnection = MM_newletter_STRING
rsEmailAddress.Source = "SELECT email FROM email"
rsEmailAddress.CursorType = 0
rsEmailAddress.CursorLocation = 2
rsEmailAddress.LockType = 1
rsEmailAddress.Open()
rsEmailAddress_numRows = 0
%>
<%
'just a message to the admin
Response.Write ("Newsletters are being created"
response.Write ("<p>"
'loop through entries
While not rsEmailAddress.EOF
%>
<%
Dim strRecipient
Dim strFrom
Dim strSubject
Dim strBody
Dim Jmail
'get the results from the create newsletter form
strFrom = Request.Form("from"
strSubject = Request.Form("subject"
strBody = Request.Form("message"
strRecipient = rsEmailAddress.Fields.Item("email".Value
'create an instance of the Jmail object
Set Jmail = Server.CreateObject("JMail.SMTPMail"
'set Jmail various properties
JMail.ServerAddress = "smtp.linksouls.com"
JMail.ContentType = "text/html"
JMail.AddRecipient strRecipient
JMail.Sender = strFrom
JMail.Subject = strSubject
JMail.Body = strBody
JMail.addHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR"
Jmail.Execute
'print message for every entry
Response.Write ("message sent to " & strRecipient & "<br>"
'move to next entry in database
rsEmailAddress.MoveNext
Wend
'message to admin saying creation has completed
Response.Write ("newsletter creation completed "
%>
<%
rsEmailAddress.Close()
Set rsEmailAddress = Nothing
%>
-----------------------------------------------------------------------------------
Any help you could give me would be really great.