Microsoft launches its first Embedded Operating System Specifically for Portable Navigation Device (PND) Manufacturers.
http://www.microsoft.com/Presspass/press/2008/jun08/06-16WENavReadyPR.mspx?rss_fdn=Press%20Releases
Microsoft launches its first Embedded Operating System Specifically for Portable Navigation Device (PND) Manufacturers.
http://www.microsoft.com/Presspass/press/2008/jun08/06-16WENavReadyPR.mspx?rss_fdn=Press%20Releases
In Dotnet, System.Net.Mail namespace provides the classes for sending e-mails. The code given below is the sample.
Imports System
Imports System.Net.Mail
Public Class Form1
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Try
Dim objMailMsg As MailMessage = New MailMessage(txtFrom.Text, txtTo.Text)
objMailMsg.Subject = txtSubject.Text
objMailMsg.Body = txtBody.Text
objMailMsg.Priority = MailPriority.High
objMailMsg.IsBodyHtml = True
Dim objSMTPClient As Net.Mail.SmtpClient = New Net.Mail.SmtpClient()
objSMTPClient.Host = “your host address”
objSMTPClient.Send(objMailMsg)
Catch ex As Exception
Throw ex
End Try
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtBody.Clear()
txtFrom.Clear()
txtTo.Clear()
txtSubject.Clear()
End Sub
End Class
For the above code to work, Create a new VB.Net windows application project, and design a form with From, To, Subject, Body fields And Send, Clear Buttons.
Most importantly, Dont forget to add the System.Web.dll reference (right click on project -> Add Reference -> Browse for the System.Web.dll reference.
Happy Working. See you later…
Till then,
Priya.
This example shows how to add e-mail to Microsoft Outlook outbox using VB.Net .The most improtant point here to get this working is to add a reference to “Microsoft Outlook object library”, In case of Microsoft Outlook 2002, Add “Microsoft Outlook 9.0 object library” (Right click on the project -> Add References -> Select the COM tab -> Select “Microsoft Outlook 9.0 object library”.
Public Class Form1
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
If (txtTo.Text.Length > 0 And txtSubject.Text.Length > 0 And txtBody.Text.Length > 0) Then
Try
Dim ol As New Outlook.Application()
Dim ns As Outlook.NameSpace
Dim fdMail As Outlook.MAPIFolder
ns = ol.GetNamespace(”MAPI”)
ns.Logon(, , True, True)
‘creating a new MailItem object
Dim newMail As Outlook.MailItem
‘gets defaultfolder for my Outlook Outbox
fdMail = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox)
‘assign values to the newMail MailItem
newMail = fdMail.Items.Add(Outlook.OlItemType.olMailItem)
newMail.Subject = txtSubject.Text
newMail.Body = txtBody.Text
newMail.To = txtTo.Text
newMail.SaveSentMessageFolder = fdMail
newMail.Send()
Catch ex As Exception
Throw ex
End Try
End If
End Sub
End Class