home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / sendsm1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-09-29  |  6.0 KB  |  193 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "mswinsck.ocx"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Send E-Mail, directly through VB."
  6.    ClientHeight    =   4470
  7.    ClientLeft      =   150
  8.    ClientTop       =   675
  9.    ClientWidth     =   4875
  10.    Icon            =   "Form1.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4470
  15.    ScaleWidth      =   4875
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   3  'Windows Default
  18.    Begin MSWinsockLib.Winsock SMTP 
  19.       Left            =   4440
  20.       Top             =   0
  21.       _ExtentX        =   741
  22.       _ExtentY        =   741
  23.       _Version        =   393216
  24.    End
  25.    Begin VB.Frame Frame1 
  26.       Height          =   1935
  27.       Left            =   120
  28.       TabIndex        =   4
  29.       Top             =   0
  30.       Width           =   4575
  31.       Begin VB.TextBox txtSub 
  32.          Height          =   285
  33.          Left            =   840
  34.          TabIndex        =   8
  35.          Text            =   "Subject Here"
  36.          Top             =   360
  37.          Width           =   3615
  38.       End
  39.       Begin VB.TextBox txtTo 
  40.          Height          =   285
  41.          Left            =   840
  42.          TabIndex        =   7
  43.          Text            =   "Whoever@whatever.com"
  44.          Top             =   720
  45.          Width           =   3615
  46.       End
  47.       Begin VB.TextBox txtFrom 
  48.          Height          =   285
  49.          Left            =   840
  50.          TabIndex        =   6
  51.          Text            =   "Your E-Mail, name, it's up to you."
  52.          Top             =   1080
  53.          Width           =   3615
  54.       End
  55.       Begin VB.TextBox txtServer 
  56.          Height          =   285
  57.          Left            =   840
  58.          TabIndex        =   5
  59.          Text            =   "something like... mail.hotmail.com usually works."
  60.          Top             =   1440
  61.          Width           =   3615
  62.       End
  63.       Begin VB.Label Label1 
  64.          Caption         =   "Subject:"
  65.          Height          =   255
  66.          Index           =   0
  67.          Left            =   120
  68.          TabIndex        =   12
  69.          Top             =   360
  70.          Width           =   1095
  71.       End
  72.       Begin VB.Label Label1 
  73.          Caption         =   "To:"
  74.          Height          =   255
  75.          Index           =   1
  76.          Left            =   480
  77.          TabIndex        =   11
  78.          Top             =   720
  79.          Width           =   1095
  80.       End
  81.       Begin VB.Label Label1 
  82.          Caption         =   "From:"
  83.          Height          =   255
  84.          Index           =   2
  85.          Left            =   360
  86.          TabIndex        =   10
  87.          Top             =   1080
  88.          Width           =   1095
  89.       End
  90.       Begin VB.Label Label2 
  91.          Caption         =   "Server:   "
  92.          Height          =   255
  93.          Left            =   240
  94.          TabIndex        =   9
  95.          Top             =   1440
  96.          Width           =   1095
  97.       End
  98.    End
  99.    Begin VB.CommandButton cmdCancel 
  100.       Caption         =   "&Cancel"
  101.       Height          =   375
  102.       Left            =   3840
  103.       TabIndex        =   2
  104.       Top             =   3960
  105.       Width           =   735
  106.    End
  107.    Begin VB.CommandButton cmdSend 
  108.       Caption         =   "&Send"
  109.       Height          =   375
  110.       Left            =   2880
  111.       TabIndex        =   1
  112.       Top             =   3960
  113.       Width           =   735
  114.    End
  115.    Begin VB.TextBox txtBody 
  116.       Height          =   1575
  117.       Left            =   120
  118.       MultiLine       =   -1  'True
  119.       ScrollBars      =   2  'Vertical
  120.       TabIndex        =   0
  121.       Text            =   "Form1.frx":0442
  122.       Top             =   2280
  123.       Width           =   4575
  124.    End
  125.    Begin VB.Label lblStats 
  126.       Caption         =   "Ready....."
  127.       Height          =   255
  128.       Left            =   120
  129.       TabIndex        =   13
  130.       Top             =   4080
  131.       Width           =   2655
  132.    End
  133.    Begin VB.Label Label3 
  134.       Caption         =   "Message Body:"
  135.       Height          =   255
  136.       Left            =   240
  137.       TabIndex        =   3
  138.       Top             =   2040
  139.       Width           =   1815
  140.    End
  141.    Begin VB.Menu mnuAbout 
  142.       Caption         =   "&Information"
  143.    End
  144. Attribute VB_Name = "Form1"
  145. Attribute VB_GlobalNameSpace = False
  146. Attribute VB_Creatable = False
  147. Attribute VB_PredeclaredId = True
  148. Attribute VB_Exposed = False
  149. Option Explicit
  150. ' contain the info neede to send E_Mail
  151. Dim sTo      As String
  152. Dim sFrom    As String
  153. Dim sSubject As String
  154. Dim sServer  As String
  155. Dim sBody    As String
  156. Private Sub cmdCancel_Click()
  157.     Unload Me
  158.     End
  159. End Sub
  160. ' once all needed inf is gathered send the mail in one line of code.
  161. Private Sub cmdSend_Click()
  162.     Mail sSubject, sTo, sFrom, sBody, sServer
  163. End Sub
  164. Private Sub mnuAbout_Click()
  165.    MsgBox " I wasn't sure if you wanted to send mail through a visible interface, or through code." & _
  166.           " SO I made this project accomplish both tasks with minimal work. After you change the form and winsock control to a more suiting name, you should be able to send e_mail with one line of code..... I hope. Please let me know of any problems. " & vbCrLf & vbCrLf & "    gh0ul"
  167.           
  168. End Sub
  169. ' when
  170. Private Sub SMTP_DataArrival(ByVal bytesTotal As Long)
  171. On Error Resume Next
  172.     Dim datad As String
  173.     SMTP.GetData datad, vbString
  174.     LastSMTP = datad
  175. End Sub
  176. ' notice I did no Error checking, that means if you don't enter
  177. ' the info right, it may not work.
  178. Private Sub txtBody_Change()
  179.     sBody = txtBody
  180. End Sub
  181. Private Sub txtFrom_Change()
  182.    sFrom = txtFrom
  183. End Sub
  184. Private Sub txtServer_Change()
  185.     sServer = txtServer
  186. End Sub
  187. Private Sub txtSub_Change()
  188.     sSubject = txtSub
  189. End Sub
  190. Private Sub txtTo_Change()
  191.     sTo = txtTo
  192. End Sub
  193.