www.pudn.com > 20063518740652.zip > HELLO32.FRM


VERSION 4.00 
Begin VB.Form Hello  
   Appearance      =   0  'Flat 
   BackColor       =   &H80000005& 
   Caption         =   "Hello" 
   ClientHeight    =   6000 
   ClientLeft      =   2355 
   ClientTop       =   1770 
   ClientWidth     =   6090 
   BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
      Name            =   "MS Sans Serif" 
      Size            =   8.25 
      Charset         =   0 
      Weight          =   700 
      Underline       =   0   'False 
      Italic          =   0   'False 
      Strikethrough   =   0   'False 
   EndProperty 
   ForeColor       =   &H80000008& 
   Height          =   6690 
   Left            =   2295 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   6000 
   ScaleWidth      =   6090 
   Top             =   1140 
   Width           =   6210 
   Begin VB.Menu mSend  
      Caption         =   "SendEmail" 
   End 
End 
Attribute VB_Name = "Hello" 
Attribute VB_Creatable = False 
Attribute VB_Exposed = False 
Option Explicit 
 
Dim SmtpHostName As String 
Dim MyEmailAddr As String 
Dim EmailMsg As String 
Dim EmailSubj As String 
Dim EmailTo As String 
Dim LogFileName As String 
Dim NullString As String 
 
 
 
Private Sub Form_Load() 
Show 
SmtpHostName = "mail.hiwaay.net" 
MyEmailAddr = "" 
EmailMsg = "Hello!" 
EmailSubj = "This is a test" 
EmailTo = "" 
LogFileName = "HELLO.LOG" 
 
Print "SMTP Host  "; Tab(14); ": "; SmtpHostName 
Print "Email From "; Tab(13); ": "; MyEmailAddr 
Print "Email To   "; Tab(13); ": "; EmailTo 
Print "Subject "; Tab(13); ": "; EmailSubj 
Print "Message "; Tab(13); ": "; EmailMsg 
Print 
Print "If the above is correct, push SendEmail to" 
Print "send the email, else click [X] to close. " 
End Sub 
 
 
Private Sub mSend_Click() 
Dim Code As Long 
Dim Buffer As String * 81 
 
' define parameters (edit before compiling) 
 
NullString = Chr$(0) 
 
' define LOG file 
 
Code = seeStringParam(SEE_LOG_FILE, LogFileName) 
 
' connect to the SMTP server 
 
Print "Connecting to server "; SmtpHostName 
Code = seeSmtpConnect(SmtpHostName, MyEmailAddr, NullString) 
If Code < 0 Then 
  Code = seeErrorText(Code, Buffer, 80) 
  Print Left$(Buffer, Code) 
Else 
  ' get server IP address 
  Code = seeDebug(SEE_GET_SERVER_IP, Buffer, 80) 
  Print "Connected to server IP "; Left$(Buffer, Code) 
  ' send the email 
  Print "Sending email to "; EmailTo; 
  Code = seeSendEmail(EmailTo, NullString, NullString, EmailSubj, EmailMsg, NullString) 
  Print " OK." 
  If Code < 0 Then 
    Code = seeErrorText(Code, Buffer, 80) 
    Print Left$(Buffer, Code) 
  End If 
End If 
 
' close the connection 
Print "Closing connection..." 
Code = seeClose() 
 
Print "Click [X] to exit" 
End Sub