Friday, December 23, 2011

E-Mailer Account Configuration Form

E-Mailer Account Configuration Form


Form Codes:

Just Copy Paste in form Code Area

Private Sub Email_Account_Setting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       
        With M_E_Mails.Load_Mail_Settings()
            Tx_Email_ID.Text = .P_Email_Id
            Tx_Password.Text = .P_Password
            Tx_Pop_Svr_Port.Text = .P_Pop3_Port

            If .P_Pop3_SSL.ToString = "1" Then
                Chk_Pop_SSL.Checked = True
            Else
                Chk_Pop_SSL.Checked = False
            End If

            If .P_Smtp_SSL.ToString = "1" Then
                Chk_Smtp_SSL.Checked = True
            Else
                Chk_Smtp_SSL.Checked = False
            End If

            Tx_Pop_Svr.Text = .P_Pop3_Svr
            Tx_Smtp_Port.Text = .P_Smtp_Port
            'Chk_Smtp_SSL.Checked = .P_Smtp_SSL
            Tx_Smtp_Svr.Text = .P_Smtp_Svr
            Tx_User_Name.Text = .P_User_Name
        End With

    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim SSL_Smtp As String
        Dim SSL_Pop3 As String

        If Tx_Password.Text = Tx_Conform_Pass.Text Then
            If Chk_Pop_SSL.Checked = True Then
                SSL_Pop3 = "1"
            Else
                SSL_Pop3 = "0"
            End If

            If Chk_Smtp_SSL.Checked = True Then
                SSL_Smtp = "1"
            Else
                SSL_Smtp = "0"
            End If
            M_E_Mails.Write_Mail_Settings(Tx_Smtp_Svr.Text, Tx_Pop_Svr.Text, Tx_Smtp_Port.Text, _
                                          Tx_Pop_Svr_Port.Text, SSL_Smtp, SSL_Pop3, Tx_Email_ID.Text, _
                                          Tx_Password.Text, Tx_User_Name.Text)

        Else
            MsgBox("Password Mismach")
        End If
        Me.Close()
    End Sub



Form Layout Codes:
Paste Following Codes in Form designer


<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Email_Account_Setting
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    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.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.Tx_User_Name = New System.Windows.Forms.TextBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Tx_Email_ID = New System.Windows.Forms.TextBox()
        Me.TabControl1 = New System.Windows.Forms.TabControl()
        Me.TabPage1 = New System.Windows.Forms.TabPage()
        Me.Tx_Conform_Pass = New System.Windows.Forms.MaskedTextBox()
        Me.Tx_Password = New System.Windows.Forms.MaskedTextBox()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.TabPage2 = New System.Windows.Forms.TabPage()
        Me.Chk_Smtp_SSL = New System.Windows.Forms.CheckBox()
        Me.Chk_Pop_SSL = New System.Windows.Forms.CheckBox()
        Me.Tx_Smtp_Port = New System.Windows.Forms.TextBox()
        Me.Tx_Pop_Svr_Port = New System.Windows.Forms.TextBox()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Tx_Smtp_Svr = New System.Windows.Forms.TextBox()
        Me.Tx_Pop_Svr = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.TabControl1.SuspendLayout()
        Me.TabPage1.SuspendLayout()
        Me.TabPage2.SuspendLayout()
        Me.SuspendLayout()
        '
        'Tx_User_Name
        '
        Me.Tx_User_Name.Location = New System.Drawing.Point(22, 35)
        Me.Tx_User_Name.Name = "Tx_User_Name"
        Me.Tx_User_Name.Size = New System.Drawing.Size(225, 20)
        Me.Tx_User_Name.TabIndex = 0
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(22, 17)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(60, 13)
        Me.Label1.TabIndex = 1
        Me.Label1.Text = "User Name"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(22, 67)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(46, 13)
        Me.Label2.TabIndex = 3
        Me.Label2.Text = "Email ID"
        '
        'Tx_Email_ID
        '
        Me.Tx_Email_ID.Location = New System.Drawing.Point(22, 85)
        Me.Tx_Email_ID.Name = "Tx_Email_ID"
        Me.Tx_Email_ID.Size = New System.Drawing.Size(225, 20)
        Me.Tx_Email_ID.TabIndex = 2
        '
        'TabControl1
        '
        Me.TabControl1.Controls.Add(Me.TabPage1)
        Me.TabControl1.Controls.Add(Me.TabPage2)
        Me.TabControl1.Location = New System.Drawing.Point(10, 11)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(442, 247)
        Me.TabControl1.TabIndex = 5
        '
        'TabPage1
        '
        Me.TabPage1.Controls.Add(Me.Tx_Conform_Pass)
        Me.TabPage1.Controls.Add(Me.Tx_Password)
        Me.TabPage1.Controls.Add(Me.Label4)
        Me.TabPage1.Controls.Add(Me.Label3)
        Me.TabPage1.Controls.Add(Me.Tx_Email_ID)
        Me.TabPage1.Controls.Add(Me.Tx_User_Name)
        Me.TabPage1.Controls.Add(Me.Label2)
        Me.TabPage1.Controls.Add(Me.Label1)
        Me.TabPage1.Location = New System.Drawing.Point(4, 22)
        Me.TabPage1.Name = "TabPage1"
        Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
        Me.TabPage1.Size = New System.Drawing.Size(434, 221)
        Me.TabPage1.TabIndex = 0
        Me.TabPage1.Text = "Account Setting"
        Me.TabPage1.UseVisualStyleBackColor = True
        '
        'Tx_Conform_Pass
        '
        Me.Tx_Conform_Pass.Location = New System.Drawing.Point(22, 180)
        Me.Tx_Conform_Pass.Name = "Tx_Conform_Pass"
        Me.Tx_Conform_Pass.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
        Me.Tx_Conform_Pass.Size = New System.Drawing.Size(225, 20)
        Me.Tx_Conform_Pass.TabIndex = 9
        '
        'Tx_Password
        '
        Me.Tx_Password.Location = New System.Drawing.Point(22, 134)
        Me.Tx_Password.Name = "Tx_Password"
        Me.Tx_Password.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
        Me.Tx_Password.Size = New System.Drawing.Size(225, 20)
        Me.Tx_Password.TabIndex = 8
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.Location = New System.Drawing.Point(22, 163)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(91, 13)
        Me.Label4.TabIndex = 7
        Me.Label4.Text = "Confirm Password"
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(20, 117)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(53, 13)
        Me.Label3.TabIndex = 6
        Me.Label3.Text = "Password"
        '
        'TabPage2
        '
        Me.TabPage2.Controls.Add(Me.Chk_Smtp_SSL)
        Me.TabPage2.Controls.Add(Me.Chk_Pop_SSL)
        Me.TabPage2.Controls.Add(Me.Tx_Smtp_Port)
        Me.TabPage2.Controls.Add(Me.Tx_Pop_Svr_Port)
        Me.TabPage2.Controls.Add(Me.Label7)
        Me.TabPage2.Controls.Add(Me.Label8)
        Me.TabPage2.Controls.Add(Me.Tx_Smtp_Svr)
        Me.TabPage2.Controls.Add(Me.Tx_Pop_Svr)
        Me.TabPage2.Controls.Add(Me.Label5)
        Me.TabPage2.Controls.Add(Me.Label6)
        Me.TabPage2.Location = New System.Drawing.Point(4, 22)
        Me.TabPage2.Name = "TabPage2"
        Me.TabPage2.Padding = New System.Windows.Forms.Padding(3)
        Me.TabPage2.Size = New System.Drawing.Size(434, 221)
        Me.TabPage2.TabIndex = 1
        Me.TabPage2.Text = "Mail Setting"
        Me.TabPage2.UseVisualStyleBackColor = True
        '
        'Chk_Smtp_SSL
        '
        Me.Chk_Smtp_SSL.AutoSize = True
        Me.Chk_Smtp_SSL.Location = New System.Drawing.Point(361, 134)
        Me.Chk_Smtp_SSL.Name = "Chk_Smtp_SSL"
        Me.Chk_Smtp_SSL.Size = New System.Drawing.Size(46, 17)
        Me.Chk_Smtp_SSL.TabIndex = 13
        Me.Chk_Smtp_SSL.Text = "SSL"
        Me.Chk_Smtp_SSL.UseVisualStyleBackColor = True
        '
        'Chk_Pop_SSL
        '
        Me.Chk_Pop_SSL.AutoSize = True
        Me.Chk_Pop_SSL.Location = New System.Drawing.Point(361, 85)
        Me.Chk_Pop_SSL.Name = "Chk_Pop_SSL"
        Me.Chk_Pop_SSL.Size = New System.Drawing.Size(46, 17)
        Me.Chk_Pop_SSL.TabIndex = 12
        Me.Chk_Pop_SSL.Text = "SSL"
        Me.Chk_Pop_SSL.UseVisualStyleBackColor = True
        '
        'Tx_Smtp_Port
        '
        Me.Tx_Smtp_Port.Location = New System.Drawing.Point(234, 132)
        Me.Tx_Smtp_Port.Name = "Tx_Smtp_Port"
        Me.Tx_Smtp_Port.Size = New System.Drawing.Size(121, 20)
        Me.Tx_Smtp_Port.TabIndex = 10
        '
        'Tx_Pop_Svr_Port
        '
        Me.Tx_Pop_Svr_Port.Location = New System.Drawing.Point(234, 82)
        Me.Tx_Pop_Svr_Port.Name = "Tx_Pop_Svr_Port"
        Me.Tx_Pop_Svr_Port.Size = New System.Drawing.Size(121, 20)
        Me.Tx_Pop_Svr_Port.TabIndex = 8
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.Location = New System.Drawing.Point(234, 114)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(93, 13)
        Me.Label7.TabIndex = 11
        Me.Label7.Text = "SMTP Server Port"
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.Location = New System.Drawing.Point(234, 64)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(85, 13)
        Me.Label8.TabIndex = 9
        Me.Label8.Text = "POP Server Port"
        '
        'Tx_Smtp_Svr
        '
        Me.Tx_Smtp_Svr.Location = New System.Drawing.Point(22, 132)
        Me.Tx_Smtp_Svr.Name = "Tx_Smtp_Svr"
        Me.Tx_Smtp_Svr.Size = New System.Drawing.Size(206, 20)
        Me.Tx_Smtp_Svr.TabIndex = 6
        '
        'Tx_Pop_Svr
        '
        Me.Tx_Pop_Svr.Location = New System.Drawing.Point(22, 82)
        Me.Tx_Pop_Svr.Name = "Tx_Pop_Svr"
        Me.Tx_Pop_Svr.Size = New System.Drawing.Size(206, 20)
        Me.Tx_Pop_Svr.TabIndex = 4
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.Location = New System.Drawing.Point(22, 114)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(117, 13)
        Me.Label5.TabIndex = 7
        Me.Label5.Text = "Outgoing SMTP Server"
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.Location = New System.Drawing.Point(22, 64)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(109, 13)
        Me.Label6.TabIndex = 5
        Me.Label6.Text = "Incoming POP Server"
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(377, 264)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(75, 23)
        Me.Button1.TabIndex = 6
        Me.Button1.Text = "Close"
        Me.Button1.UseVisualStyleBackColor = True
        '
        'Email_Account_Setting
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(462, 294)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.TabControl1)
        Me.Name = "Email_Account_Setting"
        Me.Text = "Email_Account_Setting"
        Me.TabControl1.ResumeLayout(False)
        Me.TabPage1.ResumeLayout(False)
        Me.TabPage1.PerformLayout()
        Me.TabPage2.ResumeLayout(False)
        Me.TabPage2.PerformLayout()
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents Tx_User_Name As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Tx_Email_ID As System.Windows.Forms.TextBox
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
    Friend WithEvents Tx_Conform_Pass As System.Windows.Forms.MaskedTextBox
    Friend WithEvents Tx_Password As System.Windows.Forms.MaskedTextBox
    Friend WithEvents Tx_Smtp_Port As System.Windows.Forms.TextBox
    Friend WithEvents Tx_Pop_Svr_Port As System.Windows.Forms.TextBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Tx_Smtp_Svr As System.Windows.Forms.TextBox
    Friend WithEvents Tx_Pop_Svr As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Chk_Smtp_SSL As System.Windows.Forms.CheckBox
    Friend WithEvents Chk_Pop_SSL As System.Windows.Forms.CheckBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
End Class

No comments:

Post a Comment