%@ Language=VBScript %>
<%Response.Buffer=true%>
<% PageTitle = "SiteManager - Send Message" %>
<% PageID=900 %>
<%
Header
Menu PageID
NewsletterSend
Footer
Sub NewsletterSend
Errors=0
MailID=Request.QueryString("MID")
Set mcMail = Server.CreateObject("WadesBindery.cMail")
mcMail.GetMail cint(MailID)
txtSubject=mcMail.Subject
txtLetter=mcMail.Message
If Request.QueryString("T")=1 then
Subject=DisprepText(txtSubject)
Message=DisPrepText(txtLetter)
Set ASPMail = Server.CreateObject("SMTPsvg.Mailer")
'ASPMail.QMessage = true
ASPMail.ContentType = "text/html"
ASPMail.FromName = "Wades Bindery Repair Service Ltd."
ASPMail.FromAddress = "info@wadesbindery.com"
ASPMail.RemoteHost = "209.47.206.2"
ASPMail.AddRecipient "Test Message","info@wadesbindery.com"
ASPMail.Subject = Subject
ASPMail.BodyText = Message
If not ASPMail.SendMail Then Errors=1
Set ASPMail=Nothing
Response.Redirect("mail_list.asp?TE=" & Errors)
End If
If Request.Form("hidSend")="send" Then
error=""
Subject=DisprepText(txtSubject)
Message=DisPrepText(txtLetter)
arrMList=mcMail.GetMailList
If IsEmpty(arrMList) then
error="There are currently no Accounts.
The Newsletter can not be sent."
Else
For x=0 to Ubound(arrMList,2)
Set ASPMail = Server.CreateObject("SMTPsvg.Mailer")
'ASPMail.QMessage = true
ASPMail.ContentType = "text/html"
ASPMail.FromName = "Wades Bindery Repair Service Ltd."
ASPMail.FromAddress = "info@wadesbindery.com"
ASPMail.RemoteHost = "209.47.206.2"
ASPMail.AddRecipient "Subscriber",arrMList(0,x)
ASPMail.Subject = Subject
ASPMail.BodyText = Message
mailerrors="The following addresses could not be sent:
"
If not ASPMail.SendMail Then
Errors = 1
If ASPMail.Response <> "" Then
mailouterror=ASPMail.Response ' Retrieve it
Else
mailouterror="Undetermined Mail Error"
End If
mailerrors=mailerrors & arrMList(0,x) & " Mail error: " & mailouterror & "
"
End If
Set ASPMail=Nothing
Next
mcMail.MarkSent cint(MailID)
End If
End If
Set mcMail=Nothing
%>
| <%= FormatDateTime(Date,1) %> |
<%
If Request.Form("hidSend")="send" then
If error<>"" then%>
| <%=error%> |
| |
<%Else%>
| The Newsletter has been sent. |
<%If Errors=1 then%>
| <%=mailerrors%> |
<%End If%>
| |
<%End If
End If%>
Subject <%=DisPrepText(txtSubject)%> |
Message <%=DisPrepText(txtLetter)%> |
|
| |
<% End Sub %>