468,514 Members | 962 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

Data stream as attached in Classic ASP using CDO

Does anyone know how to attached a data stream to CDO Message email sending object in Classic ASP using Javascript?

Pls. let me know if u know!

I have following code which is not working.

var myMail = Server.CreateObject("CDO.Message");
var cdoContentDispostion = "urn:schemas:mailheader:content-disposition";
var cdoBase64 = "base64";
var sContent="test datas";

myMail.Subject="Downloads";
myMail.From="balaji.sivan@parker.com";
myMail.To="balaji.sivan@parker.com";
myMail.TextBody="This is a message.";
//myMail.AddAttachment
var oPart = myMail.Attachments.Add();
oPart.ContentMediaType = "application/octet-stream";
oPart.ContentTransferEncoding = cdoBase64;
oPart.Fields(cdoContentDisposition).Value = "attachment;filename=""Test.txt""";
oPart.Fields.Update();

var oStreamOut = oPart.GetDecodedContentStream();
//oStreamOut.Write(BinaryData);
oStreamOut.WriteText(sContent);
oStreamOut.Flush();

myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2;
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp1.us.parker.corp";
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25;
myMail.Configuration.Fields.Update();
myMail.Send();
Nov 15 '11 #1
0 1282

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by gurumare | last post: by
4 posts views Thread by Lorn | last post: by
2 posts views Thread by Cuong.Tong | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.