www.pudn.com > 20063518740652.zip > HELLO16.FRM
VERSION 2.00
Begin Form Hello
Caption = "Hello"
ClientHeight = 6000
ClientLeft = 2355
ClientTop = 1770
ClientWidth = 6090
Height = 6690
Left = 2295
LinkTopic = "Form1"
ScaleHeight = 6000
ScaleWidth = 6090
Top = 1140
Width = 6210
Begin Menu mSend
Caption = "SendEmail"
End
End
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
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
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