Option Strict On Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents txtFrom As System.Windows.Forms.TextBox Friend WithEvents txtTo As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtSubject As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents txtBody As System.Windows.Forms.TextBox Friend WithEvents txtServer As System.Windows.Forms.TextBox Friend WithEvents Label5 As System.Windows.Forms.Label <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.txtFrom = New System.Windows.Forms.TextBox() Me.txtTo = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() Me.txtSubject = New System.Windows.Forms.TextBox() Me.Label3 = New System.Windows.Forms.Label() Me.txtBody = New System.Windows.Forms.TextBox() Me.Label4 = New System.Windows.Forms.Label() Me.txtServer = New System.Windows.Forms.TextBox() Me.Label5 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(496, 256) Me.Button1.Name = "Button1" Me.Button1.TabIndex = 0 Me.Button1.Text = "Send" ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(16, 48) Me.Label1.Name = "Label1" Me.Label1.TabIndex = 1 Me.Label1.Text = "From" ' 'txtFrom ' Me.txtFrom.Location = New System.Drawing.Point(128, 48) Me.txtFrom.Name = "txtFrom" Me.txtFrom.Size = New System.Drawing.Size(440, 20) Me.txtFrom.TabIndex = 2 Me.txtFrom.Text = "de@compagnie.com" ' 'txtTo ' Me.txtTo.Location = New System.Drawing.Point(128, 80) Me.txtTo.Name = "txtTo" Me.txtTo.Size = New System.Drawing.Size(440, 20) Me.txtTo.TabIndex = 4 Me.txtTo.Text = "a@compagnie.com" ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(16, 80) Me.Label2.Name = "Label2" Me.Label2.TabIndex = 3 Me.Label2.Text = "To" ' 'txtSubject ' Me.txtSubject.Location = New System.Drawing.Point(128, 112) Me.txtSubject.Name = "txtSubject" Me.txtSubject.Size = New System.Drawing.Size(440, 20) Me.txtSubject.TabIndex = 6 Me.txtSubject.Text = "Sujet" ' 'Label3 ' Me.Label3.Location = New System.Drawing.Point(16, 112) Me.Label3.Name = "Label3" Me.Label3.TabIndex = 5 Me.Label3.Text = "Subject" ' 'txtBody ' Me.txtBody.Location = New System.Drawing.Point(128, 144) Me.txtBody.Multiline = True Me.txtBody.Name = "txtBody" Me.txtBody.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.txtBody.Size = New System.Drawing.Size(440, 104) Me.txtBody.TabIndex = 8 Me.txtBody.Text = "Contenu du message" ' 'Label4 ' Me.Label4.Location = New System.Drawing.Point(16, 144) Me.Label4.Name = "Label4" Me.Label4.TabIndex = 7 Me.Label4.Text = "Body" ' 'txtServer ' Me.txtServer.Location = New System.Drawing.Point(128, 16) Me.txtServer.Name = "txtServer" Me.txtServer.Size = New System.Drawing.Size(440, 20) Me.txtServer.TabIndex = 10 Me.txtServer.Text = "VotreServeurSMTP" ' 'Label5 ' Me.Label5.Location = New System.Drawing.Point(16, 16) Me.Label5.Name = "Label5" Me.Label5.TabIndex = 9 Me.Label5.Text = "Server" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(576, 294) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtServer, _ Me.Label5, Me.txtBody, Me.Label4, Me.txtSubject, Me.Label3, Me.txtTo, Me.Label2, _ Me.txtFrom, Me.Label1, Me.Button1}) Me.Name = "Form1" Me.Text = "Test d'envoi de courriels" Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try 'Votre message Dim objMessage As New System.Web.Mail.MailMessage() With objMessage .From = txtFrom.Text .To = txtTo.Text '.Cc= '.Bcc= .Body = txtBody.Text .BodyFormat = Web.Mail.MailFormat.Text .Subject = txtSubject.Text '.Attachments= End With 'Quel serveur utiliser? System.Web.Mail.SmtpMail.SmtpServer = txtServer.Text 'Envoi du message System.Web.Mail.SmtpMail.Send(objMessage) objMessage = Nothing Catch ex As Exception MessageBox.Show(ex.ToString) End Try End Sub End Class>Hi Eric!