function SendAttach() {
var theApp //Reference to Outlook.Application
var theMailItem //Outlook.mailItem
//Attach Files to the email
var attach3 = "c:\\mail\\test.txt"
//Construct the Email including To(address),subject,body
//var recipient
var subject = "Email Using JavaScript"
var msg = "This is a test mail,sent to you using javascript by kushan thakershy"
//Create a object of Outlook.Application
try {
var theApp = new ActiveXObject("Outlook.Application");
var objNS = theApp.GetNameSpace('MAPI');
var theMailItem = theApp.CreateItem(0) // value 0 = MailItem
//Bind the variables with the email
theMailItem.to = "[email protected]"
theMailItem.Subject = (subject);
theMailItem.Body = (msg);
theMailItem.Attachments.add(attach3);
theMailItem.display();
//Show the mail before sending for review purpose
//You can directly use the theMailItem.send() function
//if you do not want to show the message.
}
catch (err) {
alert("The following may have cause this error: \n" +
"1. The Outlook express 2003 is not installed on the machine.\n" +
"2. The msoutl.olb is not availabe at the location " +
"C:\\Program Files\\Microsoft Office\\OFFICE11\\msoutl.old on client's machine " +
"due to bad installation of the office 2003." +
"Re-Install office2003 with default settings.\n" +
"3. The Initialize and Scripts ActiveX controls not marked as safe is not set to enable.")
document.write("[url=\]" + "Go Back" + "[/url]")
}
}
Das funktioniert einwandfrei, aber in meinem Fall möchte ich den Pfad der Anhangsdatei vom serverseitigen Code erhalten, weil ich Crystal Reports als Anhang senden möchte.
Wie erhalte ich diesen Pfad von der Serverseite??
Ich verwende Javascript, um den Standard-Mail-Client in der C#-Webanwendung von asp.net zu öffnen. unten ist mein Code.
[code] function SendAttach() { var theApp //Reference to Outlook.Application var theMailItem //Outlook.mailItem //Attach Files to the email var attach3 = "c:\\mail\\test.txt" //Construct the Email including To(address),subject,body //var recipient var subject = "Email Using JavaScript" var msg = "This is a test mail,sent to you using javascript by kushan thakershy" //Create a object of Outlook.Application try { var theApp = new ActiveXObject("Outlook.Application"); var objNS = theApp.GetNameSpace('MAPI'); var theMailItem = theApp.CreateItem(0) // value 0 = MailItem //Bind the variables with the email theMailItem.to = "[email protected]" theMailItem.Subject = (subject); theMailItem.Body = (msg); theMailItem.Attachments.add(attach3); theMailItem.display();
//Show the mail before sending for review purpose //You can directly use the theMailItem.send() function //if you do not want to show the message.
} catch (err) { alert("The following may have cause this error: \n" + "1. The Outlook express 2003 is not installed on the machine.\n" + "2. The msoutl.olb is not availabe at the location " + "C:\\Program Files\\Microsoft Office\\OFFICE11\\msoutl.old on client's machine " + "due to bad installation of the office 2003." + "Re-Install office2003 with default settings.\n" + "3. The Initialize and Scripts ActiveX controls not marked as safe is not set to enable.") document.write("[url=\]" + "Go Back" + "[/url]") }
} [/code]
Das funktioniert einwandfrei, aber in meinem Fall möchte ich den Pfad der Anhangsdatei vom serverseitigen Code erhalten, weil ich Crystal Reports als Anhang senden möchte. Wie erhalte ich diesen Pfad von der Serverseite??
Meine 2013-Installation von Outlook diente zum Hosten eines Epix-E-Mail-Kontos und eines Outlook-Kontos. Die Outlook 2013-App stellte keine Verbindung mehr zum Outlook-E-Mail-Konto her, daher habe...
Ich habe eine E -Mail -Funktionalität in meiner .NET -Web -API und es funktioniert in Dev/Tests einwandfrei. Aber in UAT sendet es keine E -Mails. Bei weiteren Untersuchungen stellte fest, dass UAT...
Ich versuche, eine E -Mail mit der neuesten Version des Flutter -Mailer -Pakets zu senden. Ich möchte Outlook auch als SMTP -Server verwenden. Ich folge dem Beispiel der Google Mail -Version, aber...
Ich habe mit ein kostenloses Google-Formularüberprüfungs-Widget entworfen.
Tatsächlich habe ich mehrere Javascripte in meiner E-Mail und verschiedene Google-Widgets ausprobiert, keines davon wird in...
Ich habe mit ein kostenloses Google-Formularüberprüfungs-Widget entworfen.
Tatsächlich habe ich mehrere Javascripte in meiner E-Mail und verschiedene Google-Widgets ausprobiert, keines davon wird in...