using System; using System.Collections.Generic; using System.Linq; using System.Web; using MongoDB.Driver; using MongoDB.Bson; using AIAHTML5.API.Properties; using AIAHTML5.API.Constants; using log4net; using System.Net.Mail; using AIAHTML5.API.Utility; using System.Text; using System.IO; using System.Net.Mime; namespace AIAHTML5.API.Models { public class ResetUser { public static bool SendEmail(dynamic UserDetails, bool isPassword) { try { List lstLinkedResource = new List(); EmailUtility sEmailUtility = new EmailUtility(); List lstToAddress = new List(); List lstBccAddress = new List(); LinkedResource LinkImage; string ParseText = ""; int TextPos = 0; int MinPos = 0; string ImgSrc = ""; int Counter = 0; string sEmailText = string.Empty; string _userId = string.Empty; string _password = string.Empty; string _userMail = string.Empty; string _userName = string.Empty; string _fName = string.Empty; string _lName = string.Empty; foreach (KeyValuePair kvp in UserDetails) { if (kvp.Key == "loginId") _userId = kvp.Value.ToString(); if (kvp.Key == "password") _password = kvp.Value.ToString(); if (kvp.Key == "emailId") _userMail = kvp.Value.ToString(); if (kvp.Key == "firstName") _fName = kvp.Value.ToString(); if (kvp.Key == "lastName") _lName = kvp.Value.ToString(); } string _fullName = _fName + " " + _lName; ImgSrc = "//52.2.38.120/content/images/common/logo-large.png"; ImgSrc = "//192.168.86.34:82/content/images/common/logo-large.png"; string _logoPath = HttpContext.Current.Server.MapPath("//52.2.38.120/content/images/common/logo-large.png"); string _templatePath = string.Empty; if (!isPassword) _templatePath = "~/Templates/forgot-UserId.html"; else _templatePath = "~/Templates/forgot-Password.html"; string _resetPassLink = "//192.168.86.34:82?e:"+ HttpUtility.UrlEncode(_userMail); string mailBody = ResetUser.ReadMailBodyTextFromFile(_templatePath, _userId, _password, _userMail, _fullName, _resetPassLink); //sBody.Append("
AIA
Forgot UserID
 
Hello {userName}
 
You have requested your 'Login ID' for following account: {emailId}
 
Your login ID is: {loginId}
 
 
 
A.D.A.M. – the company that pioneered online health content – is dedicated to creating and offering the most effective and innovative educational solutions possible for teaching medical science and improving health literacy.
 
Give us a call toll-free at 1-888-278-9614 or send us an email if you have any questions or if you need help. It will be our pleasure to help you.
 
 
© 2017 Ebix, Inc. All Rights Reserved.
"); lstToAddress.Add(_userMail); sEmailText = mailBody; // for embedding images in email if (sEmailText.Contains(""; AlternateView alternateView = AlternateView.CreateAlternateViewFromString(htmlBody, null, MediaTypeNames.Text.Html); alternateView.LinkedResources.Add(inline); return alternateView; } } }