Hi All,
Iam trying to open a window of outlook with the help of mailto: attribute in c#. To execute the mailto: iam deploying a new process.Below is my code which is given in the button click event.
System.Text.StringBuilder Mystring = new System.Text.StringBuilder();
Mystring.Append("mailto:");
Mystring.Append("&Subject=Finance profit and loss&body=this is test
body");
Process myProcess = new Process();
myProcess.StartInfo.FileName = Mystring.ToString();
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.RedirectStandardOutput=false;
myProcess.Start();
myProcess.Dispose();
But this is generating an error like given below.
System.ComponentModel.Win32Exception: An attempt was made to reference a token that does not exist
Iam kind of lost. Please help me out
And this is a web application. Does that matter? If so how would i fire a mailto: event from a c# code with cc and bcc as the values from the database.
Yes, you can't do it the way you are trying to do. Check out this page to see how to create a hyperlink:
http://finadmin.utoledo.edu/bus_sys_support/training/WebAuthoring/mailto.htm
Hi,
Use the following java script to open the Outlook Express
function OpenEmail(description)
{
var currentWindow = GetContentWnd();
var oDoc = currentWindow.document;
var strDescription = ((description == null) || (description == "")) ? oDoc.title : description;
if(oDoc.title == "")
currentWindow.location.href = "mailto:?body="+BuildEmailDescription(strDescription, AddParamToURL(currentWindow.location.href, strEmailString));
else
currentWindow.location.href = "mailto:?subject="+escape(oDoc.title)+"&body="+BuildEmailDescription(strDescription, currentWindow.location.href);
return true;
}
function BuildEmailDescription(strDescription,hRef)
{
return escape("Here's a great article on ASPAlliance.com that you might be interested in:" +
String.fromCharCode(13)+ String.fromCharCode(13) + strDescription + String.fromCharCode(13) + "URL: " + hRef);
}
0 comments:
Post a Comment