by Ben Camp (1 Submission)
Category: Internet/HTML
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Fri 5th March 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)
A quick sample showing how to send an email with Visual Basic
' <b>Visual Basic Usage Example</b>
' <b>(c) 1999, Geocel International, Inc.</b>
' Create DevMailer Object
Set Mailer = CreateObject("Geocel.Mailer")
' Add first SMTP server
Mailer.AddServer "mail",25
' Set Sender Information
Mailer.FromAddress = "[email protected]"
Mailer.FromName = "First Last"
' Add a recipient to the message
Mailer.AddRecipient "[email protected]","You"
' Set the Subject and Body
Mailer.Subject = "Welcome to DevMailer"
Mailer.Body = "Test Message Body Line 1" & VbCrLf & _
"Test Message Body Line 2" & VbCrLf
' Send Email - Perform Error Checking
bSuccess = Mailer.Send()
If bSuccess = False Then
If Mailer.Queued = False Then
MsgBox( "Could not send message..queueing failed!" )
Else
MsgBox( "Could not send message..queued instead!" )
End If
Else
MsgBox( "Message Sent Successfully!" )
End If