amigo02
Programmer
- Feb 19, 2003
- 109
Hi there
I want to attach a file to outlook email using javascript within a web page. The following code works fine without attachments.
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace("MAPI");
mailFolder = nameSpace.getDefaultFolder(6);
mailItem = mailFolder.Items.add('IPM.Note.FormA');
mailItem.Subject="CUSTOMER SERVICE";
mailItem.To = document.frmM.txtEmail.value;
mailItem.HTMLBody = "SOME HTML CODE";
mailItem.display (0);
What I really want to do is attaching a file to this email message, so when I add the following line into the code above it should work fine but it does not.
mailItem.Attachments.Add = "C:\temp\xxx.txt"
this line creates an error. How can I do this?
I want to attach a file to outlook email using javascript within a web page. The following code works fine without attachments.
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace("MAPI");
mailFolder = nameSpace.getDefaultFolder(6);
mailItem = mailFolder.Items.add('IPM.Note.FormA');
mailItem.Subject="CUSTOMER SERVICE";
mailItem.To = document.frmM.txtEmail.value;
mailItem.HTMLBody = "SOME HTML CODE";
mailItem.display (0);
What I really want to do is attaching a file to this email message, so when I add the following line into the code above it should work fine but it does not.
mailItem.Attachments.Add = "C:\temp\xxx.txt"
this line creates an error. How can I do this?