ResetMessage Method


Destroys contained Message object and creates new one thus resetting all properties and collections of contained Message object to their default values.

You may use this method to create and send multiple messages over the same connection.


ObjectName.ResetMessage  
Parameters: None 
Return value None  

Usage example:

Dim Mailer
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.SMTP")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.SMTP")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.ServerName = "mail.server.com"
If Mailer.Connect Then
  Mailer.Message.ToAddr = "bill@yoursite.com"
  Mailer.Message.FromAddr = "joe@mysite.com"
  Mailer.Message.Subject = "Hello"
  Mailer.Message.ImportBodyText "C:\docs\letter.htm", True
  Mailer.Send ' First message will have HTML body
  Mailer.ResetMessage
  Mailer.Message.ToAddr = "john@server1.com"
  Mailer.Message.FromAddr = "ed@server2.com"
  Mailer.Subject = "How are you?"  
  Mailer.Send ' Second message will have empty body
  Mailer.Disconnect
End If

See Also:

Message Property
Send Method


Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.