Using ASP to implement the email system supporting the attachment (3)

Source: Internet
Author: User
Tags trim
Attempt to send a message, but failed, please modify the error and try again!
<script language= "JavaScript" >
Alert ("The collection group you entered is malformed!") The correct format is: ' gr:001 ' ");
History.back ();
</script>
<p>
<%
Response.End
Else
Thegroup= (Mid (Trim (Strfieldvalue), 4))
End If
End If
Tmpsql= "SELECT * from T_group where owner= '" &session ("myID") & "' and Groupidowner= '" &thegroup& ""
' Response.Write Tmpsql
Set Tmprs=server. CreateObject ("ADODB.") Recordset ")
Tmprs. Open Tmpsql,conn
If Tmprs.bof or tmprs.eof then
' The group was not found
%>
Attempt to send a message, but failed, please modify the error and try again!
<script language= "JavaScript" >
Alert ("The collection group you entered <%=thegroup%> was not found!") ");
History.back ();
</script>
<p>
<%
Response.End
Else
If Tmprs ("Personnum") =0 Then
' No users in group
%>
Attempt to send a message, but failed, please modify the error and try again!
<script language= "JavaScript" >
Alert ("You have entered a collection group <%=thegroup%> currently does not have any users so it cannot be sent");
History.back ();
</script>
<p>
<%
Response.End
Else
Strfieldvalue=trim (Tmprs ("Groupempl"))
Tmprs.close
Set tmprs=nothing
End If
End If
End If
If InStr (Strfieldvalue, "|") Then
' Group Hair
Allsearch=replace (Trim (strfieldvalue), "|", "', '")
Allsearch= "'" &allsearch& ""
Tmpstring=trim (strfieldvalue) & "|"
Tosearch= ""
Do While Len (tmpstring) >=5
Tosearch=left (tmpstring,5)
Tmpstring=mid (tmpstring,7)
If InStr (Tosearch, "|") Then
' Bad format
%>
Attempt to send a message, but failed, please modify the error and try again!
<script language= "JavaScript" >
Alert ("The recipient you entered is malformed!");
History.back ();
</script>
<p>
<%
Response.End
End If
Tmpsql= "SELECT * from" (select UserID to T_officer where UserID in ("&allsearch&")) Derivedtbl where userid= ' "&am p;tosearch& "'"
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.