ASPSMARTMAIL : DOCUMENTATION |
Attachments
Object Last modified: february 1st, 2000 © 2000 Advantys. All rights reserved. |
The Count property represents the number of attached files in the collection.
Syntax
.Count
Return Value
Returns a Long value which is the number of files you have added in this collection.Examples
<%
Response.Write ("Number: " & mySmartMail.Attachments.Count & "<BR>")
- or -
for i=1 to mySmartMail.Attachments.Count
Response.write mySmartMail.Attachments.Item(i).FilePathName & "<BR>"
next
%>
The Item property access to an item in this collection. This is the default method of the collection object.
Syntax
.Item(key)
Return Values
Returns a Attachment object of the collection corresponding to the key.Example
<%
for i=1 to mySmartMail.Attachments.count then
Response.Write("File=" & mySmartMail.Attachments.Item(i).FilePathName)
end if
%>
The Add method adds a new Attachment in the collection.
Syntax
.Add(FilePathName[,ContentType, inLine])
Parameters
The FilePathName (string value) parameter represents the complete path of the file.
The ContentType (string value) parameter is optional and allows you to define the MIME Type of the file. Its default value is "application/octet-stream".
The inLine (boolean value) parameter is optional define to the client programme to open or attach the attached file (default value).
Examples
<%
mySmartMail.Attachments.Add "c:\Temp\test.txt"
mySmartMail.Attachments.Add "c:\Temp\test.bmp", "image/bmp", true
mySmartMail.Attachments.Add "c:\Temp\test.doc", "application/msword", false
%>
The Clear method removes all Attachment from this collection.
Syntax
.Clear
Example
<%
mySmartMail.Attachments.Clear
%>
The Remove method removes an Attachment from this collection.
Syntax
.Remove(index)
Parameter
Index is a variant value.
It could be a string expression representing the filepathname of the Attachment to remove.
It could be a numeric expression representing the position within the collection of the Attachment to remove.Examples
<%
mySmartMail.Attachments.Remove ("c:\Temp\test.doc")
- or -
mySmartMail.Attachments.Remove (2)
%>
© 2000 Advantys. All rights reserved.