|
MailListBot Examples - Using the ResetAll Method
|
This example demonstrates using the ResetAll method. The message is addressed
to the first recipient and SetDebugMode is set to TRUE, ResetAll is called, then the message is addressed
and sent to the second recipient. The SetTestMode property is set to true, therefore no message is sent.
Check the log file for the results - note that debug mode is on for the first message and off for
the second message.
- Create the MailListBot object:
Dim oMailListBot
Set oMailListBot = Server.CreateObject ("ExclamationSoft.MailListBot.3")
If oMailListBot Is Nothing Then
Response.Write "Could not create MailListBot object"
Set oMailListBot = Nothing
Exit Function
End If
- Required Properties:
oMailListBot.SetTo = "email@domain.com"
oMailListBot.SetFrom = "email@domain.com"
oMailListBot.SetServer = "smtp.domain.com"
- Turn on debugging for the first send:
oMailListBot.SetDebugMode = True
- Send the email message:
If oMailListBot.Send = false Then
Response.Write "Failed to send message"
Response.Write "Error message:["&oMailListBot.GetErrorMsg&"]"
Set oMailListBot = Nothing
Exit Function
End If
- Call the ResetAll Method (Debug mode will be reset to it's default of FALSE):
oMailListBot.ResetAll
- Change the addressing:
oMailListBot.SetTo = "another@domain.com"
- Required Properties:
oMailListBot.SetFrom = "email@domain.com"
oMailListBot.SetServer = "smtp.domain.com"
- Send another message:
If oMailListBot.Send = false Then
Response.Write "Failed to send message"
Response.Write "Error message:["&oMailListBot.GetErrorMsg&"]"
Set oMailListBot = Nothing
Exit Function
End If
Set oMailListBot = Nothing
|
Have a suggestion for our documentation? Let us know: support@MailListBot.com. We're here to help. |