Send out an Email
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Net.Mail" %>
<script runat="server">
void Page_Load()
{
SmtpClient client = new SmtpClient();
client.Host = "localhost";
client.Port = 25;
client.Send("s@your.com", "b@mine.com", "Hi!", "Message.");
}
</script>
<html>
<head id="Head1" runat="server">
<title>Send Mail</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Email sent!
</div>
</form>
</body>
</html>
Related examples in the same category