Processing Exchange Message source code using the Easymailobject component in ASP (5)

Source: Internet
Author: User
Tags mail visual studio
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>



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.