1

I am trying to send an email with confirmation link using MVC Mailer and Web API in C#. I am able to send the email using mvc mailer. But I am not able to get the link working using MVC Mailer. Appreciate your help on this.

The SendValdationEmail() function is being called from public HttpResponseMessage Post(Registration registration) inside RegisterController which inherits from API Controller.

The email is being sent to the registered user.

When the user clicks the CONfirm link in the email then the control has to be passed to public HttpResponseMessage Put(Validation validation) inside RegisterController which inherits from API Controller.

I have tried using

<a href ="@Url.Abs(Url.Action("Put", "Register"))"> CONFIRM.</a>

But it is erroring out when i try to execute this code.

How can I accomplish this?

Saritha
  • 19
  • 11
  • 5
    To fix it, you have to make the link work. If you need help, you have to provide at least the basics like your code, because we are only telepathic geniuses between Jan 1st and Dec. 24th. – nvoigt Dec 30 '13 at 16:29
  • what you have tried.. paste basic code... – J R B Dec 31 '13 at 08:20
  • Modified with the basic code that I have used. – Saritha Dec 31 '13 at 16:42
  • I still don't understand the flow through your different methods, but I will say you cannot use a link to call a POST or PUT action in Web API. This must be done using either an HTML form with a submit button (POST only) or AJAX (POST or PUT). – jebar8 Dec 31 '13 at 22:33

0 Answers0