-1

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?

user3859666
  • 279
  • 1
  • 10
  • 24
  • 1
    What is there here that isn't worth putting in [your previous question](http://stackoverflow.com/questions/26482745/trigger-a-mail-from-another-mail-body-on-clicking-link)? – Psychemaster Oct 21 '14 at 12:58

1 Answers1

0

I would like to comment, but cant because i dont have enough rep. But i noticed you are escaping the "" in the href, why not use '' instead? Not sure if this is the problem but escaping the characters seems kinda useless to me here.

Koen
  • 634
  • 3
  • 14