⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newsletterg.asp

📁 一个虚拟主机代理系统
💻 ASP
字号:
<%'=========================================
'ScriptMate User Manager Version 2.1
'Copyright 2001 (C) ScriptMate.Com
'Admin Module
'This module helps to send a newsletter to members in a group.
'For any help with modification to
'this file contact support@scriptmate.com
'=========================================

Sub Newsletterg()

	dim todo, action, group, content, subject, nummembers, message, messagestatus, smumquery1, records, tempar, i, toname, subjectfinal, messagebody,usergroups_userid,result, n
	
	session("smbulkmail") = true
	
	smumadminheader("Group Newsletter")

	if not Application("smumdebugmode") then on error resume next
	
	action = request("action")
	todo = Request("todo")

	if todo = "" then

	elseif todo = "check" then

		group = request.form("group")
		content = Request.Form ("content")		
		subject = Request.Form ("subject")		

		smumquery = "select count(*) as nummembers from smum_usergroupstbl where usergroups_groupid = "& group
		smumOpenrs smumquery,"smumrs1",action
		
			if smumrs1.eof or smumrs1("nummembers") = 0 then
				messagestatus = false
			else
				nummembers = smumrs1("nummembers")
				message = "There are currently "&nummembers&" member(s), please click ""Send the Newsletter""  to send the following newsletter to <b>"&getgroupname(group)&"</b> group."
				messagestatus = true
			end if

		smumClosers(smumrs1)

		if messagestatus then

			content = replace(content, vbcrlf, "<br>")

			smumFormAction "<form action="""&smumadminpage&"?action=newsletterg"" method=post>"
			smumFormHiddenField "todo","send"
			smumFormHiddenField "group",group
			smumFormHiddenField "content",request("content")
			smumFormHiddenField "subject",request("subject")
			smumFormOpenTable
			smumFormHeader "Send a Newsletter to "&getgroupname(group)&" group members"
			smumFormFields "Result",message
			smumFormFields "Subject",subject
			smumFormFields "Content",content
			smumFormButtons "<input class=fieldbox type=submit value=""Send the Newsletter"" name=submit>"
			smumFormCloseTable
			smumFormClose
			
		else
		
			smumFormOpenTable
			smumFormHeader "Send a Newsletter to "&getgroupname(group)&" group members"
			smumFormResponse "There are currently no members so you cannot send any newsletter."
			smumFormCloseTable

		end if

	elseif todo = "send" then

		group = request.form("group")
		content = Request.Form ("content")		
		subject = Request.Form ("subject")		

		smumquery1 = "select usergroups_userid from smum_usergroupstbl where usergroups_groupid = "& group
		smumOpenrs smumquery1,"smumrs1",action

			if smumrs1.eof then
				
				records = false
				smumFormOpenTable
				smumFormHeader "Send a Newsletter to "&getgroupname(group)&" group members"
				smumFormResponse "There are currently no members so you cannot send any newsletter."
				smumFormCloseTable

			else
				records = true
				tempar = smumrs1.getrows	
			end if	

		smumClosers(smumrs1)
				
		if records then
				
			n = 0
			for i = 0 to ubound(tempar,2)

				usergroups_userid = tempar(0,i)
				toname = convertmes("#$firstname$#",usergroups_userid)
				subjectfinal = convertmes(subject, usergroups_userid) 
				messagebody = convertmes(content, usergroups_userid) 
				result = sendmail(Application("smumadminemail"), convertmes("#$email$#",usergroups_userid), Application("smumadminname"), toname, Application("smummailserver"), subjectfinal, messagebody, Application("smummailcomponent"))		
				n = n + 1
			next

		end if

		if result = "sent" then

			smumFormOpenTable
			smumFormHeader "Send a Newsletter to a Individual Group"
			if application("smummessagequeuing") and session("smbulkmail") then
				smumFormResponse "Newsletter queued to "&i&" user(s) successfully. Please <a href=""/smusermanager/utilities/bulksend.asp?todomail=send"" target=_blank>click here</a> to send the queue."
			else
				smumFormResponse "Newsletter sent to "&i&" user(s) successfully."
			end if
			smumFormCloseTable

		else

			smumFormOpenTable
			smumFormHeader "Send a Newsletter to a Individual Group"
			smumFormResponse result
			smumFormCloseTable
		
		end if
	
	end if

End Sub%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -