easyMailObjectコンポーネントを使用して、ASPでエクスチェンジメールソースコードを処理します - センドメール(p_sendmail.asp)
<%@言語= vbscript%>
<%
'**********************************
'このファイルは、電子メールの送信に使用されます
'著者:Awayeah
'電子メール:[email protected]
'**********************************
session( "straccount")= ""またはsession( "strpassword")= "" then
Response.End
ifを終了します
%>
<html>
<head>
<Meta name = "generator" content = "Microsoft Visual Studio 6.0">
</head>
<style>
<! -
A {テキスト装飾:なし}
- >
</style>
<body>
<%set smtp = createObject( "easymail.smtp.5")
smtp.licensekey = "awa/s19i500r1ax30c0r3100"
smtp.mailserver = "192.9.200.89"
smtp.subject = request.form( "件名")
smtp.bodytext = request.form( "bodytext")
smtp.from = request.form( "from")
smtp.fromaddr = request.form( "fromaddr")
smtp.addrecipient request.form( "from")、request.form( "receive1")、1
'添付ファイルを追加します
if request.form( "att")= "" then
Response.Write ""
それ以外
x = smtp.addattachment(request.form( "att")、0)
x = 0ではない場合
Response.write「添付ファイルエラーを挿入: " + cstr(x) +"管理者に連絡してください。 "。」
ifを終了します
ifを終了します
x = smtp.send
x = 0の場合
'Response.Write( "<p align = center> <br> <br>")
'Response.Write( "<font size =")
respons.write "<p align = 'center'> <br> <br> <b> <font face = 'zongyi' size = 'color ='#00ffff '> <span style =' background-color:# 000080 '>電子メールは正常に送信されました!</font> </span> </b> "
'セッション( "送信")= "y"
それ以外
x = 7またはx = 5の場合
respons.write "<br> <br> <p align = 'center'> <b> <font face = 'zongyi' size = 'color ='#00ffff '> <span style =' background-color:# 000080 '>電子メールの送信でエラーが発生しました( " + cstr(x) +")
<br> <br> <入力型= "button" value = "back">
<%Response.End
それ以外
respons.write "<br> <br> <p align = 'center'> <b> <font face = 'zongyi' size = 'color ='#00ffff '> <span style =' background-color:# 000080 '>電子メールを送信するときにエラーが発生しました: "+ cstr(x)+" </span> </font> </b> "%>
<br> <br> <入力型= "button" value = "return" id = button1 name = button1>
<%Response.End
ifを終了します
ifを終了します
smtp =何も設定しません
%>
<p align = "center"> <a href = "javascript:window.close();">
<font face = "宋体" size = "5"> <b> <span style = "background-color:#ffff00"> return </span> </b> </font> </a> </p>
</body>
</html>