Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sending E-Mail. Microsoft SMTP Service Simple Mail Transport Protocol Does not support the Post Office Protocol (POP) InetPub\MailRoot\Pickup InetPub\MailRoot\Drop.

Similar presentations


Presentation on theme: "Sending E-Mail. Microsoft SMTP Service Simple Mail Transport Protocol Does not support the Post Office Protocol (POP) InetPub\MailRoot\Pickup InetPub\MailRoot\Drop."— Presentation transcript:

1 Sending E-Mail

2 Microsoft SMTP Service Simple Mail Transport Protocol Does not support the Post Office Protocol (POP) InetPub\MailRoot\Pickup InetPub\MailRoot\Drop Send e-mail receive e-mail

3 Sending a Simple E-Mail Message Sub Button_Click( s As Object, e As EventArgs ) SmtpMail.Send( _ mailfrom.Text, _ mailto.Text, _ mailsubject.Text, _ mailbody.Text ) End Sub

4 Sending a Simple E-Mail Message SendMail.aspx Send Mail: From: <asp:TextBox ID="mailfrom" Columns="50" Runat="Server" /> To: <asp:TextBox ID="mailto" Columns="50" Runat="Server" /> Subject: <asp:TextBox ID="mailsubject" Columns="50" Runat="Server" /> Body: <asp:TextBox ID="mailbody" TextMode="Multiline" Columns="50" Rows="10" Runat="Server" /> <asp:Button Text="Send!" OnClick="Button_Click" Runat="Server" />

5 Adding Attachments <% Dim objMailMessage As MailMessage Dim objMailAttachment As MailAttachment ' Create the Mail Attachment objMailAttachment = New MailAttachment( "c:\BizPlan.doc" ) ' Create the Mail Message objMailMessage = New MailMessage objMailMessage.From = "you@somewhere.com" objMailMessage.To = "joe@somewhere.com" objMailMessage.Subject = "Secret Business Plan" objMailMessage.Body = "Here's the plan (don't show it to anyone!)" objMailMessage.Attachments.Add( objMailAttachment ) ' Send the Mail Message SmtpMail.Send( objMailMessage ) %> BizPlan Sent!

6 Sending HTML E-Mail <% Dim objMailMessage As MailMessage Dim strHTMLBody As String ' Create the HTML Message Body strHTMLBody = " " & _ " Thank You! " & _ " " & _ "Thank you for registering!" & _ " " ' Create the Mail Message objMailMessage = New MailMessage objMailMessage.From = "you@somewhere.com" objMailMessage.To = "joe@somewhere.com" objMailMessage.Subject = "Thanks for Registering!" objMailMessage.Body = strHTMLBody objMailMessage.BodyFormat = MailFormat.HTML ' Send the Mail Message SmtpMail.Send( objMailMessage ) %> HTML Email Sent!


Download ppt "Sending E-Mail. Microsoft SMTP Service Simple Mail Transport Protocol Does not support the Post Office Protocol (POP) InetPub\MailRoot\Pickup InetPub\MailRoot\Drop."

Similar presentations


Ads by Google