0

Introdution

I am currently working a system develop with C#.

The system is about request approval. When a request made, system will send email to user ask for response.

User's response will as simple as approve, reject or request update.

Question/Problem

Is it possible to have a button (approve or reject) in email content which allow user to response to system with only one click but without open browser?

Or, Is it possible to create button in email content which enable user to click to create new email with pre-set subject and recipient like following:

subject: request id - 123 - action - approve

to: response@system.com

as response email for user to send.

Then system can then recognize the email received and perform required back-end process.

Research Done

Research 1

What I currently found was outlook appointment email. it done like second solution create new email with content for user send a response. But, it only have options accept, decline and tentative.

And, I am not sure is blackberry support it like outlook.

The following is the blog found to create appointment email: http://chuckdotnet.blogspot.my/2007/10/send-outlook-meeting-requests-with.html

Research 2

The following website teach you how to create hyperlink in email content which can create new email with pre-populate subject, body, and recipient

https://community.articulate.com/discussions/building-better-courses/hyperlink-to-create-an-already-written-email

However, No test had perform in blackberry yet.

Appreciate for any suggestion from you guys and I willing to try.

Raymond Loo
  • 1
  • 1
  • 3

1 Answers1

0

Is it possible to sent an email with button which can click to create email with some pre-set content?

Yes, this is possible, see the System.Net.Mail code in the .NET framework. https://msdn.microsoft.com/en-us/library/system.net.mail(v=vs.110).aspx

You can also see this StackOverflow question about how this is used. Send e-mail via SMTP using C#

MailMessage mail = new MailMessage("you@yourcompany.com", "user@hotmail.com");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.google.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);

Finally, your code should fire a serverside post on button click to have the server take care of sending the email. If data needs to be posted to the server, you may want to consider putting this data in a form input, which will post to your controller. You can then take that data and build the email with the example I provided in the links.

Community
  • 1
  • 1
Chris Hawkes
  • 11,923
  • 6
  • 58
  • 68
  • hi Chris, thank for your reply. I am able send email through the site and used same solution as well and let me edit the question to make it more clear. – Raymond Loo Mar 16 '16 at 15:55