Last post Dec 17, 2009 10:18 PM by dso808
Dec 17, 2009 12:17 AM|dso808|LINK
OK here's my present code to email a confirmation to a user who's just updated a trouble ticket:
private void EmailTicketUpdate(String TicketNum)
StringBuilder MyMsg = new StringBuilder();
LoginName = HttpContext.Current.User.Identity.Name.ToString();
SubmitterAddress = LoginName.Remove(0, 4) + "@fhb.com";
ProbTicketSubj = "Problem Ticket #" + TicketNum + " - " + radioStatus.Text;
MyMsg.AppendFormat("Problem ticket #" + TicketNum + " has been " + radioStatus.Text);
MyMsg.AppendLine("Description: " + txtDescription.Text.ToString());
MyMsg.AppendLine("Impact Statement: " + txtImpactStatement.Text.ToString());
MyMsg.AppendLine("Resolution Description: " + txtResolution.Text.ToString());
ProbTicketMsgBody = MyMsg.ToString();
SmtpClient client = new SmtpClient();
client.Host = "#.###.#.##";
client.Port = 25;
client.Send("firstname.lastname@example.org", SubmitterAddress, ProbTicketSubj, ProbTicketMsgBody); //Send email to submitter
So the scenario is, the user is on this page, updates a trouble ticket and then hits the UPDATE button which sends the email created from the code above.
OK, now all I want to do is simply add a hyperlink to the email which directs back to the URL of where the ticket was updated (the address of the page where the user updated the ticket which generated the email). That way the user can simply click on that
link to go back to the ticket if they need to update it again.
Thanks in advance to all that reply!
Dec 17, 2009 02:12 AM|agent|LINK
try using Request.Url
eg MyMsg.AppendLine("URL : " + Request.Url);
Dec 17, 2009 10:18 PM|dso808|LINK
Worked great agent - thanks!
Now, for those wanting to see exactly what I did, I simply added the following to my message body:
That's it. My email is plain text, not html. But no matter, the hyperlink appeared just fine in the message body. That was another point I was unsure of - how to make a hyperlink appear in just a plain text email.