<br************ ********@yahoo. co.ukwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Hi Anthony,
Thanks for the example. I'll test shortly. I am attaching plain text.
In that case I'll adjust the example:-
Const cdoContentDispo sition = "urn:schemas:ma ilheader:conten t-disposition"
Dim oPart : Set oPart = oMsg.Attachment s.Add
oPart.ContentMe diaType = "text/plain; charset=iso-8859-1"
oPart.CharSet = "iso-8859-1"
oPart.ContentTr ansferEncoding = "quoted-printable"
oPart.Fields(cd oContentDisposi tion).Value =
"attachment;fil ename=""Test.tx t"""
oPart.Fields.Up date
Dim oStreamOut: Set oStreamOut = oPart.GetDecode dContentStream
oStreamOut.Writ eText sContent
oStreamOut.Flus h
Where sContent is the string content you want to include in the email
Brendan
Anthony Jones wrote:
<br************ ********@yahoo. co.ukwrote in message
news:11******** **************@ e3g2000cwe.goog legroups.com...
Hi,
>
Does anyone know how to create an attachment using a stream in classic
ASP.
>
I can see that it can be done in ASP.Net as per the article below:
Initializes a new instance of the Attachment class with the specified
stream and name.
http://msdn2.microsoft.com/en-us/library/6sdktyws.aspx.
>
Any help is greatly appreciated.
>
regards
Brendan
>
Heres an example:-
Const cdoContentDispo stion =
"urn:schemas:ma ilheader:conten t-disposition"
Const cdoBase64 = "base64"
Set oPart = oMsg.Attachment s.Add
oPart.ContentMe diaType = "applicatio n/octet-stream"
oPart.ContentTr ansferEncoding = cdoBase64
oPart.Fields(cd oContentDisposi tion).Value = "attachment ;
filename=""Test .dat"""
oPart.Fields.Up date
Set oStreamOut = oPart.GetDecode dContentStream
oStreamOut.Writ e aByt
oStreamOut.Flus h
Where oMsg is an existing cdoMessage (ensure you've added any text
and/or
html bodies first) and abyt is the set of bytes that represents the
resource
to attach.
What type of content are you attaching?