E:\web\learnaspcom\htdocs\freebook\learn\ubtoc.xml LearnAsp.com - ASP ASP.net Free Lessons
Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll
<Asp.net blog>
<personal site>
xxx

Utility Belt:Email Capabilities
by Charles Carroll

The code below shows the email functionality "Utility Belt" functions. The MailMsg sub is the centerpiece of Utility Belt. This method is also used internally to email errors that occur at runtime to a designated email address. See our UtilityBelt.config basics @
utilitybelt_config.aspx

The Email Sample is one demo of The Email "Utility Belt" functionality.

   filename=/experiments/utilitybelt/vercurrent/ubdemo_mail.aspx

<Test Script Below>


<%@ debug="true" %>
<%@ Assembly src="utilitybelt.vb" %>
<script language="VB" runat="server">
    dim ub1 as new LearnAsp.utilitybelt()
Sub Page_Load(S As Object, E As EventArgs)
    ub1.options("Debug-on,xray-to-page-on")
    Dim strBodyofMail as string
    strBodyOfMail="I am thinking about"
    strBodyOfMail &= vbcrlf & "the dark side!!!" 
    strBodyOfMail &= vbcrlf & "Let me know if you need a hand!"
    Dim hashMyMail as new hashtable
    with hashMyMail
        .Add("to", "Anakin Skywalker <darthcarroll@learnasp.com>")
        .Add("from", "Sith Lord <jedi@senate.com>")
        .Add("subject","need help?")
        .Add("body",strBodyOfMail)
    end with
    ' ub1.Xray(hashMymail,"hashMymail")
    ub1.MailMsg(hashMymail)
End Sub
</script>
<html><head>
<title>Utility Belt Demo</title>
</head>
<body bgcolor="#FFFFFF">
<asp:placeholder id="plcErr" runat="server"/>
<form runat="server">
Sent A Mail!
</form>
</body></html>
Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site