1
Answer

Unable to send arguments to winform exe on click of hyperlin

Ask a question

trying to pass parameter to  Winform exe on click of Hyperlink from email.


Please find the code below to send mail having Hyperlink to open winform exe



var smtpMessage = new MailMessage();
bool isSuccess = false;
int retryCount = 0;
smtpMessage.Subject = "helloooo";
smtpMessage.From = new MailAddress("[email protected]");
StringBuilder s = new StringBuilder();
string test ="<a href=C:\\WindowsFormsApplication1\\WindowsFormsApplication1\\bin\\Debug\\WindowsFormsApplication1.exe" + " test>" + "Click</a>";

string subscriber= "[email protected]";
smtpMessage.To.Add(new MailAddress(subscriber));
smtpMessage.Body = s.ToString();
while (retryCount < 3)

{
var client = new SmtpClient();
try
{
client.Send(smtpMessage);
retryCount = 3;
isSuccess = true;
}
catch (Exception ex)
{
throw;
}
}

Answers (1)