You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
3.1 KiB
97 lines
3.1 KiB
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Mailatest.aspx.vb" Inherits="LPWeb.Mailatest" aspcompat=true%>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head runat="server">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
<title></title>
|
|
<style type="text/css">
|
|
.auto-style1 {
|
|
height: 23px;
|
|
}
|
|
.auto-style2 {
|
|
height: 26px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<script type="vbscript" runat="server">
|
|
Protected Function Btnclick()
|
|
Dim mailer As Object
|
|
Mailer = Server.CreateObject("SMTPsvg.Mailer")
|
|
mailer.FromName = "hutter@shub.ch"
|
|
mailer.FromAddress = Me.txtfrom.Text
|
|
mailer.RemoteHost = Me.txtmailserver.Text
|
|
mailer.AddRecipient("",Me.txtto.Text)
|
|
mailer.Subject = Me.txtSubject.Text
|
|
mailer.BodyText = Me.txtbody.text
|
|
If Mailer.SendMail Then
|
|
Response.Write("Mail sent...")
|
|
Else
|
|
Response.Write("Mail send failure. Error was " & Mailer.Response)
|
|
End If
|
|
End Function
|
|
|
|
</script>
|
|
<body>
|
|
<form id="form1" runat="server">
|
|
<div>
|
|
|
|
<table style="width:100%;">
|
|
<tr>
|
|
<td class="auto-style1">
|
|
<br />
|
|
<asp:Label ID="Label1" runat="server" Text="mailserver"></asp:Label>
|
|
<br />
|
|
</td>
|
|
<td class="auto-style1">
|
|
<asp:TextBox ID="txtmailserver" runat="server" Width="206px">msscript.webland.ch</asp:TextBox>
|
|
</td>
|
|
<td class="auto-style1"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<asp:Label ID="Label2" runat="server" Text="from"></asp:Label>
|
|
</td>
|
|
<td>
|
|
<asp:TextBox ID="txtfrom" runat="server" Width="210px">hutter@shub.ch</asp:TextBox>
|
|
</td>
|
|
<td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="auto-style2">
|
|
<asp:Label ID="Label3" runat="server" Text="to"></asp:Label>
|
|
</td>
|
|
<td class="auto-style2">
|
|
<asp:TextBox ID="txtto" runat="server" Width="208px">hutter@shub.ch</asp:TextBox>
|
|
</td>
|
|
<td class="auto-style2"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="auto-style2">subject</td>
|
|
<td class="auto-style2">
|
|
<asp:TextBox ID="txtSubject" runat="server" Width="211px">hutter@shub.ch</asp:TextBox>
|
|
</td>
|
|
<td class="auto-style2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="auto-style2">Body</td>
|
|
<td class="auto-style2">
|
|
<asp:TextBox ID="txtbody" runat="server" Width="213px">hutter@shub.ch</asp:TextBox>
|
|
</td>
|
|
<td class="auto-style2"> </td>
|
|
</tr>
|
|
</table>
|
|
<br />
|
|
<br />
|
|
|
|
</div>
|
|
<p>
|
|
|
|
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="btnclick" />
|
|
|
|
</p>
|
|
</form>
|
|
</body>
|
|
</html>
|