Step 1: I have a requirement like On clicking a button in my Application, Mail should be triggered to respective person in To list.
Step 2: That Mail item should contain one link like "Click here to approve".
Step 3: On clicking that link, Another Mail item should open with To: xxx@xxx.com, CC:yyy@yyy.com, subject etc...
I used the below code,
protected void Page_Load(object sender, EventArgs e)
{
string sMsg = "";
string cc = "abc@abc.com";
string Subject = "Test";
string Body = "<a href=\"mailto: xxx.xxx@ge.com?Subject=subject\">Click here to send mail</a>";
sMsg = Redirct("mailto:" + cc + "?Subject=" + Subject + "&body=" + Body);
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert", sMsg,true);
}
public string Redirct(string pagename)
{
StringBuilder sb = new StringBuilder();
sb.Append("window.location.href='" + pagename + "'; ");
return sb.ToString();
}
Above code throws error like "Command Line Argument is not valid. Verify the switch you are using" What is the issue?