Object| source code send mail (p_sendmail.asp)
<%@ Language=vbscript%>
<%
'*************************************
' This file is used to send mail
' Author: Awayeah
' E-mail: awayeah@163.net
'*************************************
If session ("straccount") = "" or Session ("strpassword") = "" Then
Response.End
End If
%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<STYLE>
<!--
A{text-decoration:none}
-->
</STYLE>
<BODY>
<% Set SMTP = CreateObject ("EASYMAIL.SMTP.5")
Smtp. LicenseKey = "awa/s19i500r1ax30c0r3100"
Smtp. MailServer = "192.9.200.89"
Smtp. Subject = Request.Form ("Subject")
Smtp. BodyText = Request.Form ("BodyText")
Smtp. from = Request.Form (' from ')
Smtp. FROMADDR = Request.Form ("fromaddr")
Smtp. AddRecipient Request.Form ("from"), Request.Form ("Receive1"), 1
' Add attachment
If Request.Form ("att") = "" Then
Response.Write ""
Else
x = SMTP. AddAttachment (Request.Form ("att"), 0)
If not x = 0 Then
Response.Write "Insert Attachment error: + CStr (x) +" Contact your administrator. "
End If
End If
x = SMTP. Send
If x = 0 Then
' Response.Write ("<p align=center><br><br>")
' Response.Write ("<font size=")
Response.Write "<p align= ' center ' ><br><br><b><font face= ' song Body ' size= ' 5 ' color= ' #00FFFF ' ><span style= ' background-color: #000080 ' > Mail has been successfully issued!</font></span></b> '
' Session ("sended") = "Y"
Else
If x=7 or x=5 then
Response.Write "<br><br><p align= ' center ' ><b><font face= ' song Body ' size= ' 5 ' color= ' #00FFFF ' ><span style= ' background-color: #000080 ' > Email error ("+ CStr (x) +"). Wrong sender Address </span></font></b > "%>
<br><br><input type= "button" onclick= "History.go ( -1)" value= "return" >
<%response.end
Else
Response.Write "<br><br><p align= ' center ' ><b><font face= ' song Body ' size= ' 5 ' color= ' #00FFFF ' ><span style= ' background-color: #000080 ' > Email error: + CStr (x) + "</span></font></b>"%>
<br><br><input type= "button" onclick= "History.go ( -1)" value= "return" Id=button1 name=button1>
<%response.end
End If
End If
Set SMTP = Nothing
%>
<p align= "center" > <a href= "javascript:window.close ();" >
<font face= "Arial" size= "5" ><b><span style= "Background-color: #FFFF00" > Return </span></b> </font></a></P>
</BODY>
</HTML>