<%
' change to address of your own SMTP server
strHost = "localhost"
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost
Mail.From = Request("From") ' From address
Mail.FromName = Request("FromName") ' optional
Mail.AddAddress Request("To")
' message subject
Mail.Subject = Request("Subject")
' message body
Mail.Body = Request("Body")
strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = Err.Description
else
bSuccess = True
End If
End If
%>
<HTML>
<HEAD>
<TITLE>Örnek Mail Bileşeni</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H2>AspEmail: mail.asp</h2>
<% If strErr <> "" Then %>
<h3><FONT COLOR="#FF0000">Hata Oluştu: <I><% = strErr %></I></FONT></h3>
<% End If %>
<% If bSuccess Then %>
<h3><FONT COLOR="#00A000">Mesaj <% = Request("To") %>. Adresine Başarı ile Gönderildi</FONT></h3>
<% End If %>
<FORM METHOD="POST" ACTION="mail.asp">
<TABLE CELLSPACING=0 CELLPADDING=2 BGCOLOR="#E0E0E0">
<TR>
<TD>Host:</TD>
<TD><B><% = strHost %></B></TD>
</TR>
<TR>
<TD>Gönderen Mail:</TD>
<TD><INPUT TYPE="TEXT" NAME="From"></TD>
</TR>
<TR>
<TD>Gönderen Adı:</TD>
<TD><INPUT TYPE="TEXT" NAME="FromName"></TD>
</TR>
<TR>
<TD>Alıcı Mail:</TD>
<TD><INPUT TYPE="TEXT" NAME="To"></TD>
</TR>
<TR>
<TD>Başlık:</TD>
<TD><INPUT TYPE="TEXT" NAME="Subject"></TD>
</TR>
<TR>
<TD>Mesaj:</TD>
<TD><TEXTAREA NAME="Body"></TEXTAREA></TD>
</TR>
<TR>
<TD COLSPAN=2><INPUT TYPE="SUBMIT" NAME="Send" VALUE="Gönder"></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
- 0 Bu dökümanı faydalı bulan kullanıcılar: