posts - 82, comments - 0, trackbacks - 0

My Links



Post Categories

C# Download


Informativa cookie



Msdn Gallery



Wiki Tecknet

Send Email with WindowsPhone

This example shows how to send email using a device with WindowsPhone.

To try this example and must have a telephone system operating WindowsPhone8, alternatively you can try it with VisualStudio and the emulator WWGA512 mb, but without the ability to send email.

With WindowsPhone 7 and 8 and not only can send Email directly from the device, but also creating our application of any type, but with the need to send email to this Microsoft gives us the class EmailComposeTask. This class provides several properties to be implemented in its entirety in order to competare everything you need to successfully send the email. Let's see one by one and see their work, the Bcc property, this property gets or sets the recipients in the Bcc line of the e-mail, the Body property gets or sets the body of the e-mail, the property gets or Cc sets the recipients in the Cc line of the e-mail, the CodePage property gets or sets the character set that will be used to display the contents of the message, the Subject property gets or sets the subject of the e-mail and finally the properties to get or set the recipients in the To line of the e-mail. There are some methods that make up the class EmailComposeTask, we will focus on the Show () method, this method allows you to start the providers installed on the device such as Hotmail, but if there are more on our device providers will all be listed and the user can choose the one he wants to send the email. Place the following piece of code and minimum required in order to send an email.  

Imports Microsoft.Phone.Controls
Imports Microsoft.Phone.Tasks

Partial Public Class MainPage
    Inherits PhoneApplicationPage

    ' Costructor
    Public Sub New()
        SupportedOrientations = SupportedPageOrientation.Portrait Or SupportedPageOrientation.Landscape
    End Sub

    'Click event BtnsendClick
    Private Sub BtnsendClick(sender As Object, e As RoutedEventArgs)
        ' Create a new instance of the class EmailComposeTask with which you can send email
        ' I enter the recipients to send the email using the To property of the class EmailComposeTask

        ' Set the title of the property by Subject

        ' Enhanced the value of the Body property EmailComposeTask class, this is the content that will display the recipient
        Dim emailcomposer = New EmailComposeTask() With { _
            .To = String.Concat("mailto:", txtEmail.Text), _
            .Subject = "Email Sample", _
            .Body = txtEmail.Text _

        ' Start the email application on your device to send the Email
    End Sub

End Class


For more information please contact us at




Print | posted on lunedì 11 marzo 2013 22:35 | Filed Under [ Articles VB.NET in English ]


No comments posted yet.

Post Comment

Please add 4 and 1 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET