*/
Written some cool source code? Upload it to Programmer's Heaven.
*/

View \frmMail.frm

WinDOS Shell 0.1A

Submitted By: Shehbaz
Rating: starstarstarstarstar (Rate It)


VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form frmMail
   BackColor       =   &H00000000&
   BorderStyle     =   0  'None
   Caption         =   "E-Mail Module"
   ClientHeight    =   6870
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   8100
   BeginProperty Font
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   6870
   ScaleWidth      =   8100
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin MSComDlg.CommonDialog cmdDialog
      Left            =   120
      Top             =   120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton cmdSelect
      Caption         =   "..."
      Height          =   255
      Left            =   7680
      TabIndex        =   16
      Top             =   1680
      Width           =   375
   End
   Begin RichTextLib.RichTextBox rtfAttach
      Height          =   735
      Left            =   0
      TabIndex        =   15
      Top             =   4080
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _ExtentY        =   1296
      _Version        =   393217
      BackColor       =   0
      TextRTF         =   $"frmMail.frx":0000
   End
   Begin VB.CommandButton cmdSend
      Caption         =   "Send"
      Default         =   -1  'True
      Height          =   495
      Left            =   120
      TabIndex        =   6
      Top             =   5400
      Width           =   1695
   End
   Begin VB.CommandButton cmdClose
      Caption         =   "Close"
      Height          =   495
      Left            =   120
      TabIndex        =   7
      Top             =   6000
      Width           =   1695
   End
   Begin MSWinsockLib.Winsock Winsock1
      Left            =   120
      Top             =   720
      _ExtentX        =   741
      _ExtentY        =   741
   End
   Begin VB.TextBox txtBody
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   4455
      Left            =   2040
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   5
      Top             =   2160
      Width           =   6015
   End
   Begin VB.TextBox txtAttach
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   285
      Left            =   2040
      TabIndex        =   4
      Top             =   1680
      Width           =   5535
   End
   Begin VB.TextBox txtSubject
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   285
      Left            =   2040
      TabIndex        =   3
      Top             =   1320
      Width           =   5895
   End
   Begin VB.TextBox txtToAddress
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   285
      Left            =   2040
      TabIndex        =   2
      Top             =   960
      Width           =   5895
   End
   Begin VB.TextBox txtFromAddress
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   285
      Left            =   2040
      TabIndex        =   1
      Top             =   600
      Width           =   5895
   End
   Begin VB.TextBox txtServer
      BackColor       =   &H00000000&
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   285
      Left            =   2040
      TabIndex        =   0
      Top             =   240
      Width           =   5895
   End
   Begin VB.TextBox txtOutput
      BackColor       =   &H00000000&
      ForeColor       =   &H0000FF00&
      Height          =   735
      Left            =   0
      TabIndex        =   17
      Top             =   3360
      Visible         =   0   'False
      Width           =   2055
   End
   Begin VB.Label lblStatus
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   0
      TabIndex        =   14
      Top             =   6600
      Width           =   8145
   End
   Begin VB.Label lblBody
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Message"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   1080
      TabIndex        =   13
      Top             =   2160
      Width           =   735
   End
   Begin VB.Label lblAttach
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Attachments"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   720
      TabIndex        =   12
      Top             =   1680
      Width           =   1155
   End
   Begin VB.Label lblSubject
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Subject"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   1080
      TabIndex        =   11
      Top             =   1320
      Width           =   735
   End
   Begin VB.Label lblToAddress
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "To Address"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   840
      TabIndex        =   10
      Top             =   960
      Width           =   1050
   End
   Begin VB.Label lblFrom
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "From Address"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   600
      TabIndex        =   9
      Top             =   600
      Width           =   1260
   End
   Begin VB.Label lblServer
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "POP Server"
      BeginProperty Font
         Name            =   "OCR A Extended"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   840
      TabIndex        =   8
      Top             =   240
      Width           =   1050
   End
End
Attribute VB_Name = "frmMail"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdClose_Click()
    Unload Me
End Sub

Private Sub cmdSelect_Click()
    cmdDialog.ShowOpen
    txtAttach = cmdDialog.filename
End Sub

Private Sub cmdSend_Click()
On Error GoTo err
    cmdSend.Enabled = False
    If ValidateEntry = False Then MsgBox "Either the server name or to address were left empty.", vbCritical + vbOKOnly, Me.Caption: cmdSend.Enabled = True: Exit Sub
    If txtAttach.Text <> "" Then
        lblStatus = "Encoding file attachment"
        Base64EncodeFile txtAttach.Text, rtfAttach, txtOutput
    End If
    lblStatus = "Connecting to POP Server"
    ConnectToServer txtServer.Text, Winsock1
err:
End Sub

Private Sub Form_Load()
    txtAttach = ""
    txtBody = ""
    txtFromAddress = ""
    txtServer = ""
    txtSubject = ""
    txtToAddress = ""
End Sub

Private Sub Winsock1_Connect()
    lblStatus = "Connected to POP Server"
    Wait 0.5
    lblStatus = "Sending mail"
    If txtAttach.Text = "" Then
        SendMail txtFromAddress, txtToAddress, txtSubject, txtBody, Winsock1
    Else
        SendMail txtFromAddress, txtToAddress, txtSubject, txtBody, Winsock1, txtAttach, txtOutput
    End If
    lblStatus = "Mail sent"
    cmdSend.Enabled = True
End Sub

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
        MsgBox "Error Number: " & Number & vbCrLf & Description & vbCrLf & Source, vbCritical + vbOKOnly, Me.Caption
End Sub

Private Function ValidateEntry() As Boolean
    ValidateEntry = True
    If txtServer.Text = "" Or txtToAddress = "" Then ValidateEntry = False
End Function

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.