Beispiel #1
0
        public static void SendEMail(string username, string password, string emailid)
        {
            try
            {
                MailHelper mailhelper = new MailHelper();
                string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/RegistrationMail.html");

                string html = File.ReadAllText(mailpath);

                html = html.Replace("%USERNAME%", username);
                html = html.Replace("%PASSWORD%", password);
                html = html.Replace("%EMAILID%", emailid);
                string fromemail = ConfigurationManager.AppSettings["fromemail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];

                string Body = mailhelper.VerificationMail(html, emailid, "");

                string Subject = "You have Added to SocialSuitePro Account";
                //            MailHelper.SendMailMessage(host, int.Parse(port.ToString()),fromemail,pass,emailid,string.Empty,string.Empty,Subject,Body);

                MailHelper.SendSendGridMail(host, Convert.ToInt32(port), fromemail, "", emailid, "", "", Subject, Body, usernameSend, pass);

            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }
Beispiel #2
0
        public static void SendInvitationEmail(string username, string sendername, string email, Guid teamid)
        {
            try
            {
                Registration reg = new Registration();
                string tid = reg.MD5Hash(email);
                MailHelper mailhelper = new MailHelper();
                string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/SendInvitation.htm");
                string html = File.ReadAllText(mailpath);
                string fromemail = ConfigurationManager.AppSettings["fromemail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];
                string urllogin = "******";
                string registrationurl = "http://ssp.socioboard.com/Registration.aspx?tid=" + teamid;
                string Body = mailhelper.InvitationMail(html, username, sendername, "", urllogin, registrationurl);
                string Subject = "You've been Invited to " + username + " SocialSuitePro Account";
                //   MailHelper.SendMailMessage(host, int.Parse(port.ToString()), fromemail, pass, email, string.Empty, string.Empty, Subject, Body);

                MailHelper.SendSendGridMail(host, Convert.ToInt32(port), fromemail, "", email, "", "", Subject, Body, usernameSend, pass);

            }
            catch (Exception ex)
            {

                logger.Error(ex.Message);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.Form != null)
            {
                string name = Request.Form["name"].ToString();
                string lname = Request.Form["lname"].ToString();
                string email = Request.Form["email"].ToString();
                string Subject = Request.Form["Subject"].ToString();
                string profile = Request.Form["profile"].ToString();


                string tomail = ConfigurationManager.AppSettings["tomail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];
                string subject = Subject;
                string Body = "Name: " + name + " " + lname + "</br>" + "Email: " + email + "</br>" + "Message: " + profile + "</br>";
               
                    // GlobusMailLib.MailHelper objMailHelper = new GlobusMailLib.MailHelper();

                    MailHelper objMailHelper = new MailHelper();
                  //  objMailHelper.SendMailByMandrillForEnterprise(name, host, Convert.ToInt32(port), email, "", "*****@*****.**", "", "", Subject, Body, usernameSend, pass);
                    objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), email, "", tomail, "", "", Subject, Body, usernameSend, pass);
                    Response.Write("success");
                


            }

        }
Beispiel #4
0
        public static void SendEMail(string username, string password, string emailid, string accounttype,string id)
        {
            try
            {
                MailHelper mailhelper = new MailHelper();
                string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/RegistrationMail.html");

                string html = File.ReadAllText(mailpath);

                html = html.Replace("%replink%", "http://www.socioboard.com/Home.aspx?stat=activate&id=" + id + "");
                //html = html.Replace("%replink%", "http://www.socioboard.com/Home.aspx");
                html = html.Replace("%USERNAME%", username);
                html = html.Replace("%pln%", accounttype);
                //html = html.Replace("%PASSWORD%", password);
                html = html.Replace("%EMAILID%", emailid);
                string fromemail = ConfigurationManager.AppSettings["fromemail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];

                string Body = mailhelper.VerificationMail(html, emailid, "");

                string Subject = "Thanks for creating your Socioboard Account";
                //            MailHelper.SendMailMessage(host, int.Parse(port.ToString()),fromemail,pass,emailid,string.Empty,string.Empty,Subject,Body);

                MailHelper.SendSendGridMail(host, Convert.ToInt32(port), fromemail, "", emailid, "", "", Subject, Body, usernameSend, pass);

            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
        }
Beispiel #5
0
        public string sendmail(string name, string designation, string company, string location, string website, string email, string phone, string message)
        {
            string ret = string.Empty;

            string tomail = ConfigurationManager.AppSettings["tomail"];
            string usernameSend = ConfigurationManager.AppSettings["username"];
            string host = ConfigurationManager.AppSettings["host"];
            string port = ConfigurationManager.AppSettings["port"];
            string pass = ConfigurationManager.AppSettings["password"];
            string Subject = "Enterprise Edition Enquiry";
            string Body = "Name: " + name + "</br>" + "Company: " + company + "</br>" + "Location: " + location + "</br>" + "Website: " + website + "</br>" + "Email: " + email + "</br>" + "Phone: " + phone + "</br>" + "Message: " + message + "</br>";
            MailHelper objMailHelper = new MailHelper();
            objMailHelper.SendMailByMandrillForEnterprise(name, host, Convert.ToInt32(port), email, "", tomail, "", "", Subject, Body, usernameSend, pass);
               // objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), email, "", tomail, "", "", Subject, Body, usernameSend, pass);

            return ret;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString != null)
            {
                string name = Request.QueryString["name"];
                string designation = Request.QueryString["designation"];
                string company = Request.QueryString["company"];
                string location = Request.QueryString["location"];
                string website = Request.QueryString["website"];
                string email = Request.QueryString["email"];
                string phone = Request.QueryString["phone"];
                string message = Request.QueryString["message"];
                string ccaptcha = Request.QueryString["captcha"];
                string scaptcha = Session["captcha"].ToString();


                string tomail = ConfigurationManager.AppSettings["tomail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];
                string Subject = "Enterprise Edition Enquiry";
                string Body = "Name: " + name + "</br>" + "Company: " + company + "</br>" + "Location: " + location + "</br>" + "Website: " + website + "</br>" + "Email: " + email + "</br>" + "Phone: " + phone + "</br>" + "Message: " + message + "</br>";
                if (ccaptcha == scaptcha)
                {
                   // GlobusMailLib.MailHelper objMailHelper = new GlobusMailLib.MailHelper();

                   MailHelper objMailHelper = new MailHelper();
                   objMailHelper.SendMailByMandrillForEnterprise(name, host, Convert.ToInt32(port), email, "", "*****@*****.**", "", "", Subject, Body, usernameSend, pass);
                   // objMailHelper.SendMailByMandrillForEnterPrise(name, host, Convert.ToInt32(port), email, "", "*****@*****.**", "", "", Subject, Body, usernameSend, pass);
                    Response.Write("success");
                }
                else
                {
                    Response.Write("Wrong captcha");
                }
            }
        }
Beispiel #7
0
        public static void SendNewsLetterEmail(string username, string sendername, string email)
        {
            try
            {
                MailHelper mailhelper = new MailHelper();
                string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/SendNewsLetter.htm");
                string html = File.ReadAllText(mailpath);
                string fromemail = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["pasword"];
                string Body = mailhelper.NewsLetterMail(html, username, sendername, "");
                string Subject = "News From SocialSuitePro Account";
                MailHelper.SendMailMessage(host, int.Parse(port.ToString()), fromemail, pass, email, string.Empty, string.Empty, Subject, Body);

            }
            catch (Exception ex)
            {

                logger.Error(ex.Message);
            }
        }
Beispiel #8
0
        public static void SendSendGridMail(string Host, int port, string from, string passsword, string to, string bcc, string cc, string subject, string body,string sendgridUserName,string sendgridPassword)
        {
            try
            {

                    var myMessage = SendGridMail.SendGrid.GetInstance();
                    myMessage.From = new System.Net.Mail.MailAddress(from);
                    myMessage.AddTo(to);
                    myMessage.Subject = subject;

                    //Add the HTML and Text bodies
                    myMessage.Html = body;
                    //myMessage.Text = "Hello World plain text!";
                    var username = sendgridUserName;
                    var pswd = sendgridPassword;

                    var credentials = new System.Net.NetworkCredential(username, pswd);
                    var transportWeb = SMTP.GetInstance(credentials);

                    // Send the email.
                    //transportWeb.Deliver(myMessage);

                    MailHelper objMailHelper = new MailHelper();
                    string res = objMailHelper.SendMailByMandrill(Host, port, from, passsword, to, bcc, cc, subject, body, sendgridUserName, sendgridPassword);

            }
            catch (Exception ex)
            {
                try
                {
                    GlobusMailLib.MailHelper objMailHelper = new GlobusMailLib.MailHelper();

                    string res=objMailHelper.SendMailByMandrill(Host, port, from, passsword, to, bcc, cc, subject, body, sendgridUserName, sendgridPassword);
                }
                catch (Exception)
                {
                    Console.WriteLine(ex.Message);
                    logger.Error(ex.Message);
                }

            }
        }
        public int AddInvitationInDB(string fname, string lname, string email)
        {
            int res = 0;
            try
            {
               if (Session["LoggedUser"] != null)
                {
                    SocioBoard.Domain.User user = (User)Session["LoggedUser"];


                    MailHelper mailhelper = new MailHelper();
                    string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/FriendInvitation.htm");
                    string html = File.ReadAllText(mailpath);
                    string fromemail = ConfigurationManager.AppSettings["fromemail"];
                    string usernameSend = ConfigurationManager.AppSettings["username"];
                    string host = ConfigurationManager.AppSettings["host"];
                    string port = ConfigurationManager.AppSettings["port"];
                    string pass = ConfigurationManager.AppSettings["password"];
                    string urllogin = "******";
                    //string registrationurl = "http://dev.socioboard.com/Registration.aspx?refid=256f9c69-6b6a-4409-a309-b1f6d1f8e43b";

                    string registrationurl = "http://dev.socioboard.com/Registration.aspx?refid=" + user.Id;

                    string Body = mailhelper.InvitationMailByCloudSponge(html, fname + " " + lname, user.EmailId, "", urllogin, registrationurl);

                    string Subject = "You've been Invited to Socioboard " + email + " Socioboard Account";


                    #region Add Records in Invitation Table
                    Invitation objInvitation = new Invitation();
                    InvitationRepository objInvitationRepository = new InvitationRepository();

                    objInvitation.Id = Guid.NewGuid();
                    objInvitation.InvitationBody = Body;
                    objInvitation.Subject = Subject;
                    objInvitation.FriendEmail = email;
                    objInvitation.SenderEmail = user.EmailId;//"*****@*****.**";
                    objInvitation.FriendName = fname + " " + lname;
                    objInvitation.SenderName = user.UserName;//"Abhaykumar";
                    objInvitation.Status = "0";

                    res = objInvitationRepository.Add(objInvitation);
                    #endregion
                }
                //else
                //{
                //    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Plaese login for this activity!');", true);

                //}

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return res;
        }
        private string InviteMember(string fname,string lname, string email)
        {
            string res = "";
            try
            {
               

                Registration reg = new Registration();
                string tid = reg.MD5Hash(email);
                MailHelper mailhelper = new MailHelper();
                string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/FriendInvitation.htm");
                string html = File.ReadAllText(mailpath);
                string fromemail = ConfigurationManager.AppSettings["fromemail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];
                string urllogin = "******";
                string registrationurl = "http://dev.socioboard.com/Registration.aspx?refid=256f9c69-6b6a-4409-a309-b1f6d1f8e43b";
                string Body = mailhelper.InvitationMailByCloudSponge(html, fname+" "+lname, "*****@*****.**", "", urllogin, registrationurl);

                string Subject = "You've been Invited to " + email + " Socioboard Account";
                //   MailHelper.SendMailMessage(host, int.Parse(port.ToString()), fromemail, pass, email, string.Empty, string.Empty, Subject, Body);
                MailHelper objMailHelper = new MailHelper();
                res = objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), fromemail, "", email, "", "", Subject, Body, usernameSend, pass);
              //MailHelper.SendSendGridMail(host, Convert.ToInt32(port), fromemail, "", email, "", "", Subject, Body, usernameSend, pass);

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return res;

        }
Beispiel #11
0
        protected void submit_Click(object sender, EventArgs e)
        {
            try
            {
                string fullpath = string.Empty;

                if (fname.Text.Trim() == "" || lname.Text.Trim() == "" || email.Text.Trim() == "" || message.InnerText.Trim() == "")
                {
                    Session["careerinfo"] = fname.Text.Trim() + "<:>" + lname.Text.Trim() + "<:>" + email.Text.Trim() + "<:>" + message.InnerText.Trim();
                    //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please fill all the fields !');", true);
                    Session["career"] = "field";
                    Response.Redirect("Company.aspx#verticalTab4");

                }
                if (!emailvalidation(email.Text.Trim()))
                {
                    //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please fill all the fields !');", true);
                    Session["career"] = "email";
                    Response.Redirect("Company.aspx#verticalTab4");
                }

                Session["careerinfo"] = fname.Text.Trim() + "<:>" + lname.Text.Trim() + "<:>" + email.Text.Trim() + "<:>" + message.InnerText.Trim();

                if (cvfile.HasFile)
                {
                    string filename = Guid.NewGuid() + cvfile.FileName;
                    filename = filename.Replace(" ","");
                    string path = Server.MapPath("~/Contents/cv/" + filename);
                    string extension = Path.GetExtension(filename).ToLower().Replace(".", "");
                    if (extension != "doc" && extension != "docx")
                    {
                        Session["career"] = "invaliedfile";
                        Response.Redirect("Company.aspx#verticalTab4");
                    }
                    cvfile.SaveAs(path);
                    fullpath = "http://socioboard.com/Contents/cv/" + filename;
                }
                else
                {
                    //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please fill all the fields !');", true);
                    Session["career"] = "nofile";
                    Response.Redirect("Company.aspx#verticalTab4");
                }
                //send mail
                string MailBody = "<body bgcolor=\"#FFFFFF\"><!-- Email Notification from socialscoup.socioboard.com-->" +
                   "<table id=\"Table_01\" style=\"margin-top: 50px; margin-left: auto; margin-right: auto;\"" +
                   " align=\"center\" width=\"650px\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ><tr>" +
                  "<td height=\"20px\" style=\"background-color: rgb(222, 222, 222); text-align: center; font-size: 15px; font-weight: bold; font-family: Arial; color: rgb(51, 51, 51); float: left; width: 100%; margin-top: 7px; padding-top: 10px; border-bottom: 1px solid rgb(204, 204, 204); padding-bottom: 10px;\">" +
                      "Socioboard</td></tr><!--Email content--><tr>" +
                  "<td style=\"background-color: #dedede; padding-top: 10px; padding-left: 25px; padding-right: 25px; padding-bottom: 30px; font-family: Tahoma; font-size: 14px; color: #181818; min-height: auto;\"><p>Name , " + fname.Text +" "+lname.Text+ "</p><p>" +
                  "email id is " + email.Text + "<a href=\"" + fullpath + "\" style=\"text-decoration:none;\"> Click here </a> to Downlaod</p><p>" +
                      "Message : " + message.InnerText + "</td></tr><tr>" +
                  "<td style=\"background-color: rgb(222, 222, 222); margin-top: 10px; padding-left: 20px; height: 20px; color: rgb(51, 51, 51); font-size: 15px; font-family: Arial; border-top: 1px solid rgb(204, 204, 204); padding-bottom: 10px; padding-top: 10px;\">Thanks" +
                  "</td></tr></table><!-- End Email Notification From socialscoup.socioboard.com --></body>";

                string username = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];
                string from = ConfigurationManager.AppSettings["fromemail"];

                //   string Body = mailformat.VerificationMail(MailBody, txtEmail.Text.ToString(), "");
                string Subject = "Socioboard career";
                //MailHelper.SendMailMessage(host, int.Parse(port.ToString()), username, pass, txtEmail.Text.ToString(), string.Empty, string.Empty, Subject, MailBody);
                //MailHelper.SendSendGridMail(host, Convert.ToInt32(port), from, "", from, string.Empty, string.Empty, Subject, MailBody, username, pass);

                MailHelper objMailHelper = new MailHelper();
               Session["response"] = objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), from, "", from, string.Empty, string.Empty, Subject, MailBody, username, pass);
                //send mail
                Session["careerinfo"] = null;
                Session["career"] = null;
                Response.Redirect("Company.aspx#verticalTab4");
               // ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Thanks for your interest ');", true);
                //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert(" + res + ");", true);
            }
            catch (Exception ex)
            {
               // Label1.Text = ex.Message;
                Console.WriteLine(ex.Message);
            }
        }
        private string InviteMember(string fname,string lname, string email)
        {
            SocioBoard.Domain.User user = (User)Session["LoggedUser"];
            UserRepository objUserRepository = new UserRepository();
            string res = "";
            try
            {
               

                Registration reg = new Registration();
                string tid = reg.MD5Hash(email);
                MailHelper mailhelper = new MailHelper();
                string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/FriendInvitation.htm");
                string html = File.ReadAllText(mailpath);


                string fromemail = ConfigurationManager.AppSettings["fromemail"];
                string usernameSend = ConfigurationManager.AppSettings["username"];
                string host = ConfigurationManager.AppSettings["host"];
                string port = ConfigurationManager.AppSettings["port"];
                string pass = ConfigurationManager.AppSettings["password"];
                string website = ConfigurationManager.AppSettings["MailSenderDomain"];
                string urllogin = website + "Default.aspx";
               // string registrationurl = "http://dev.socioboard.com/Registration.aspx?refid=256f9c69-6b6a-4409-a309-b1f6d1f8e43b";
                string registrationurl = website+"Registration.aspx?refid=" + user.Id;

                html = html.Replace("%replink%", registrationurl);
             

               // string Body = mailhelper.InvitationMailByCloudSponge(html, fname+" "+lname, "*****@*****.**", "", urllogin, registrationurl);

                string Body = mailhelper.InvitationMailByCloudSponge(html, fname + " " + lname, user.EmailId, "", urllogin, registrationurl);

                string Subject = "You have been invited to Socioboard by " + user.EmailId;
                //   MailHelper.SendMailMessage(host, int.Parse(port.ToString()), fromemail, pass, email, string.Empty, string.Empty, Subject, Body);
                MailHelper objMailHelper = new MailHelper();
                if (!objUserRepository.IsUserExist(email))
                {
                    res = objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), fromemail, "", email, "", "", Subject, Body, usernameSend, pass);
                    if (res == "Success")
                    {
                        res = "Mail sent successfully!";
                    }
                }
                else
                {
                    res = "EmailId Already Exist!";
                }
                    //MailHelper.SendSendGridMail(host, Convert.ToInt32(port), fromemail, "", email, "", "", Subject, Body, usernameSend, pass);

            }
            catch (Exception ex)
            {
                Console.WriteLine("Error : " + ex.StackTrace);
            }
            return res;

        }