| |
|
<%
if Request.ServerVariables("REQUEST_METHOD")<>"POST" THEN
%>
<%
else
Dim strSenderEmail, strSubject, strRecipient, strMessage
Dim bnFlag, toEmailCount
strSenderEmail = Request.Form("from_email")
'#flag for getting the first email and then appending all the other emails to the first email with ";"
bnFlag = false
'#Checking if email address are entered in the 10 email boxes.
toEmailCount = 0
For i=1 to 10
If Request.Form("to_email"&i) <> "" Then '# if the friends emails are filled
If checkEmail(Request.Form("to_email"&i)) Then '# Validate email
if bnFlag = false then
strRecipient = Request.Form("to_email"&i)
bnFlag = true
else
strRecipient = strRecipient & ";" & Request.Form("to_email"&i)
end if
else
Response.write("")
Response.Write(" Back to form ")
response.end
End if
Else
toEmailCount = toEmailCount + 1
End If
Next
'#check if a copy is to be sent to self
If Request.Form("sendcopy") = 1 Then
strRecipient = strRecipient & ";" & strSenderEmail
End If
strSubject="Mail from Your Friend"
strMessage = Request.Form("message")
'#Calling the Mail procedure from operations.asp
If toEmailCount <> 10 then
Mail strSenderEmail,strRecipient,strSubject,strMessage
Response.Write(" Mail sent successfully !! ")
else
Response.Write("Please enter atleast one receipient email id. ")
Response.Write("Back to form ")
end if
Response.Write("
")
' Response.Write(request.form("name_last") &" ")
' Response.Write(strSubject &" ")
' Response.Write(strSenderEmail &" ")
' Response.Write(strRecipient &" ")
' Response.Write(Request.Form("sendcopy") &" ")
' Response.End
end if
%>
|
|