I just created method to send an confirmation mail when new user register
this is the controller
if (result.Succeeded)
{
var provider = new Microsoft.Owin.Security.DataProtection.DpapiDataProtectionProvider("AFFEMS2-HEC");
UserManager.UserTokenProvider = new Microsoft.AspNet.Identity.Owin.DataProtectorTokenProvider<ApplicationUser>(provider.Create("EmailConfirmation"));
var currentUser = UserManager.FindByName(user.UserName);
var roleresult = UserManager.AddToRole(currentUser.Id, model.RoleName);
System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage(
new System.Net.Mail.MailAddress("my@email.lk", "Registration System "),
new System.Net.Mail.MailAddress(user.Email));
m.Subject = "Account Activation";
m.Body = string.Format("Dear {0},<BR/><BR/>Your account has been successfully created with the Higher Education Council. Please click on the link below to access your account. : <a href=\"{1}\" title=\"User Email Confirm\">{1}</a>", user.UserName, Url.Action("ConfirmEmail", "Account", new { Token = user.Id, Email = user.Email }, Request.Url.Scheme));
m.IsBodyHtml = true;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("##.##.##.###");
smtp.Port = ##;
smtp.Credentials = new System.Net.NetworkCredential("my@email.lk", "#######");
smtp.EnableSsl = false;
smtp.Send(m);
this.SetNotification("The User has been successfully registered. A confirmation Email has been sent to: " + user.Email, NotificationEnumeration.Success);
return RedirectToAction("View_Users", "Account");
}
Now I want
1.Attach image in to email body(above the email body)
2.Shrink the activation link (without sending large link its should contain small piece of text) of this confirmation message.
How can I achieve those things ?