The SubmissionTime property specifies when the e-mail object was submitted.
Type: | Date |
Run time: | Read-write |
object.SubmissionTime
Syntax Element | Description |
---|---|
object | E-mail (MSMQMailEMail) object that defines the e-mail message. |
Date e-mail was submitted.
Typically, mail is sent at the same time the e-mail object is submitted. However, some applications may need to store the e-mail objects (such as when communication is broken) and send the actual mail at another time.
The returned value for this property can be manipulated using standard Microsoft® Visual Basic® date and time functions such as Date$ and Time$. For descriptions of Visual Basic functions, see Visual Basic documentation.
When SubmissionTime is displayed, Visual Basic automatically converts the returned value to the local system time and system date.
This example defines an e-mail message as a form, and displays the date and time when the e-mail object was submitted.
To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, run the example, and click the form.
Dim email As New MSMQMailEMail
Private Sub Form_Click()
'****************
'* Define eimail
'****************
'Set e-mail type to text message
email.ContentType = MSMQMAIL_EMAIL_TEXTMESSAGE
'Add Recipients.
email.Recipients.Add "Exchange_User", "ExchangeUser@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO
'Set who is sending the e-mail.
email.Sender.Name = "Our name"
email.Sender.Address = "Our queue label"
'Set the subject of the e-mail.
email.Subject = "Test mail."
'Set the Body of the e-mail.
email.TextMessageData.Text = "This is the Body of the message."
'************************
'* Display SubmissionTime time.
'************************
MsgBox "The e-mail object was submitted at: " + CStr(email.SubmissionTime)
End Sub
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Import Library: Included as a resource in mqmailoa.dll.
Unicode: Defined only as Unicode.
Add, Address, ContentType, MSMQMailEMail, Name, Recipients, Sender, Subject, Text, TextMessageData