Note that there are some explanatory texts on larger screens.

plurals
  1. POSending Sign-up link to Gmail in MVC3
    primarykey
    data
    text
    <p>I want to send the signup link to Gmail account when User Registered for the First time, I mean for checking the Authenticity of the User Email address. I have achieve this but my problem is that user is not getting any link and message body also. If I am defining this two in my function its giving me error. This is My function which gives me Following Error:</p> <blockquote> <p>"An object reference is required for the non-static field, method, or property 'System.Web.Mvc.Controller.HttpContext.get'" and syntax error for message.body="".</p> </blockquote> <p>What should I do for this?</p> <pre><code>public class EmailManager { private const string EmailFrom = "noreplay@gmail.com"; public static void SendConfirmationEmail(string userName) { var user = Membership.GetUser(userName.ToString()); var confirmationGuid = user.ProviderUserKey.ToString(); //var verifyUrl = HttpContext.Current.Request.Url.GetLeftPart // (UriPartial.Authority) + "/Account/Verify/" + confirmationGuid; using (var client = new SmtpClient()) { using (var message = new MailMessage(EmailFrom, user.Email)) { message.Subject = "Please Verify your Account"; // message.Body = "To verify your account, please click the following link:" //+ "&lt;a href=\"" + verifyUrl + "\" target=\"_blank\"&gt;" + verifyUrl + " //+"&lt;/a&gt;&lt;/p&gt;&lt;div&gt;Best regards,&lt;/div&gt;&lt;div&gt;Someone&lt;/div&gt;&lt;p&gt;Do not forward " //+"this email. The verify link is private.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"; message.IsBodyHtml = true; client.EnableSsl = true; client.Send(message); }; }; } } </code></pre> <p>Please help me for this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload