private static void Main(string[] args)
        {
            // For Yandex Mail Server
            // App Config:  Must - MailFrom
            //              Must - SmtpUserName
            //              Must - SmtpPassword
            IMailHelper yandexMailHelper = new YandexMailHelper();

            yandexMailHelper.AddTo("*****@*****.**", "Çağdaş KARADEMİR");
            yandexMailHelper.AddCc("*****@*****.**", "Çağdaş KARADEMİR");
            yandexMailHelper.AddBcc("*****@*****.**", "Çağdaş KARADEMİR");
            yandexMailHelper.Body =
                @"Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus suscipit tortor eget felis porttitor volutpat. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eget tortor risus. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula.";
            yandexMailHelper.Subject = "Check Email";
            yandexMailHelper.Send();

            // For Gmail Server
            // App Config:  Must - MailFrom
            //              Must - SmtpUserName
            //              Must - SmtpPassword
            IMailHelper gmailHelper = new GmailHelper();

            gmailHelper.AddTo("*****@*****.**", "Çağdaş KARADEMİR");
            gmailHelper.AddCc("*****@*****.**", "Çağdaş KARADEMİR");
            gmailHelper.AddBcc("*****@*****.**", "Çağdaş KARADEMİR");
            gmailHelper.Body =
                @"Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus suscipit tortor eget felis porttitor volutpat. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eget tortor risus. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula.";
            gmailHelper.Subject = "Check Email";
            gmailHelper.Send();

            // For Any Smtp Server
            // App Config:  Must - MailFrom
            //              Must - SmtpUserName
            //              Must - SmtpPassword
            //              Must - SmtpHost
            //              Optional - If SmtpPort Is Not 587 - Ex : 25
            //              Optional - If SmtpIsEnableSsl Is Not true - Ex : false
            //              Optional - If MailIsBodyHtml Is Not true - Ex : false
            IMailHelper smtpMailHelper = new SmtpMailHelper();

            smtpMailHelper.AddTo("*****@*****.**", "Çağdaş KARADEMİR");
            smtpMailHelper.AddCc("*****@*****.**", "Çağdaş KARADEMİR");
            smtpMailHelper.AddBcc("*****@*****.**", "Çağdaş KARADEMİR");
            smtpMailHelper.Body =
                @"Quisque velit nisi, pretium ut lacinia in, elementum id enim. Vivamus suscipit tortor eget felis porttitor volutpat. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eget tortor risus. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula.";
            smtpMailHelper.Subject = "Check Email";
            smtpMailHelper.Send();
        }
Exemple #2
0
        public ActionResult UserDetails(FormCollection fc)
        {
            StringBuilder str = new StringBuilder();

            str.Append("Dear " + fc["VenderName"]);
            str.Append("<br/><br/>");
            str.Append("Enquiry Details:- <br/>");
            str.Append("Name:" + fc["name"] + "<br/> EmailId:" + fc["email"] + "<br/> Phone Number:" + fc["phoneNumber"] + "<br/> enquiry:" + fc["enquiry"]);
            str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>");
            str.Append($"<br/>WarmRegards,<br/> SupportTeam");
            GmailHelper.Send(fc["VendorEmailId"], "Regarding Enquiry", str.ToString());
            Roleslst();
            int id = Convert.ToInt32(Request.QueryString.Get("id"));

            return(View(DbHelper.GetTeacherTimeDetails(id)));
        }
Exemple #3
0
        public ActionResult TeacherBooking(TeacherTimeDetails objTeacherDetails)
        {
            Roleslst();
            UserEnquiry objUserEnquiry = new UserEnquiry();

            objUserEnquiry.FollowUP          = true;
            objUserEnquiry.FKUserId          = Helper.UserId;
            objUserEnquiry.FKClassId         = objTeacherDetails.ClassId;
            objUserEnquiry.FKTeacherId       = objTeacherDetails.TeacherId;
            objUserEnquiry.FKAvailableTimeId = objTeacherDetails.AvailableTeacherTimeId;
            objUserEnquiry.BookedFromDate    = Convert.ToDateTime(objTeacherDetails.FromAvailableDate).Date;
            objUserEnquiry.BookedFromTime    = new TimeSpan(Convert.ToInt32((objTeacherDetails.FromAvailableTime).Split(':')[0]), 0, 0);
            objUserEnquiry.BookedToTime      = new TimeSpan(Convert.ToInt32((objTeacherDetails.ToAvailableTime).Split(':')[0]), 0, 0).Duration();
            objUserEnquiry.BookedToDate      = Convert.ToDateTime(objTeacherDetails.ToAvailableDate).Date;
            objUserEnquiry.CreatedDate       = DateTime.Now;
            objUserEnquiry.BookingStatus     = "Processing";
            DbHelper.InsertUserEnquiry(objUserEnquiry);
            var enquiryId = objUserEnquiry.PKEnquiryId;
            //var enquiryId = 23;
            TeacherProfile obj     = DbHelper.GetTeacher(objUserEnquiry.FKTeacherId);
            UserProfile    objUser = DbHelper.GetUserProfile(obj.FKUserId);



            StringBuilder str = new StringBuilder();

            str.Append("Dear " + objUser.UserName + ",");
            str.Append("<br/><br/>");
            str.Append($"Thank you for Booking the {objTeacherDetails.TeacherName}.Your Order or Enquiry Id is {enquiryId}<br/>");
            str.Append($"Your Booking Dates and Times are:-<br/><br/>");
            str.Append($"<table  border=1><tr><th>From Date</th><th> ToDate</th><th> FromTime</th><th> ToTime</th><th>Booking Status</th></tr>");
            str.Append($"<tr><th>{ objUserEnquiry.BookedFromDate.ToShortDateString()}</th><th>  { objUserEnquiry.BookedToDate.ToShortDateString()}</th><th> {objTeacherDetails.FromAvailableTime}</th><th> {objTeacherDetails.ToAvailableTime}</th><th>{objUserEnquiry.BookingStatus}</th></tr></table>");
            str.Append($"<br/><p><strong>The Teacher has to accept your booking,So please wait for confirmation from Teacher</strong></p>");
            str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>");
            str.Append($"<br/>WarmRegards,<br/> SupportTeam");
            GmailHelper.Send(objUser.EmailId, "Regarding TeacherBooking", str.ToString());
            // GmailHelper.Send("*****@*****.**", "Regarding TeacherBooking", str.ToString());
            // str.Replace("Dear " + objUser.UserName + ",", "Dear " + obj.UserProfile.UserName + ",");
            //GmailHelper.Send(obj.UserProfile.EmailId, "Regarding User Booking ", str.ToString());
            return(View("SuccessPage", objUserEnquiry));
        }
Exemple #4
0
 public ActionResult EditUserEnquiry(UserEnquiry objUserEnquiry)
 {
     if (ModelState.IsValid)
     {
         if (objUserEnquiry.FollowUP == false)
         {
             objUserEnquiry.BookingStatus = "Cancelled By Teacher";
             StringBuilder str = new StringBuilder();
             str.Append("Dear " + objUserEnquiry.UserName + ",");
             str.Append("<br/><br/>");
             str.Append($"Thank you for Booking the {objUserEnquiry.TeacherName}.Your Order or Enquiry Id is {objUserEnquiry.PKEnquiryId}<br/>");
             str.Append($"Your Booking Dates and Times are:-<br/><br/>");
             str.Append($"<table  border=1><tr><th>From Date</th><th> ToDate</th><th> FromTime</th><th> ToTime</th><th>Booking Status</th></tr>");
             str.Append($"<tr><th>{ objUserEnquiry.BookedFromDate.ToShortDateString()}</th><th>  { objUserEnquiry.BookedToDate.ToShortDateString()}</th><th> {objUserEnquiry.BookedFromTime}</th><th> {objUserEnquiry.BookedToTime}</th><th>{objUserEnquiry.BookingStatus}</th></tr></table>");
             str.Append($"<br/><p><strong>Congra   the teacher has to accepted your booking,So please Send your PayPal Id to Teacher. Teacher Email Id is {objUserEnquiry.TeacherProfile.UserProfile.EmailId} </strong></p>");
             str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>");
             str.Append($"<br/>WarmRegards,<br/> SupportTeam");
             GmailHelper.Send(objUserEnquiry.EmailId, "Regarding TeacherBooking", str.ToString());
         }
         else
         {
             objUserEnquiry.BookingStatus = "Accepted By Teacher";
             StringBuilder str = new StringBuilder();
             str.Append("Dear " + objUserEnquiry.UserName + ",");
             str.Append("<br/><br/>");
             str.Append($"Thank you for choosing the {objUserEnquiry.TeacherName}.Your Order or Enquiry Id is {objUserEnquiry.PKEnquiryId}<br/>");
             str.Append($"Sorry say that teacher has cancelled the booking due to heavy booking on teacher");
             str.Append($"<table  border=1><tr><th>From Date</th><th> ToDate</th><th> FromTime</th><th> ToTime</th><th>Booking Status</th></tr>");
             str.Append($"<tr><th>{ objUserEnquiry.BookedFromDate.ToShortDateString()}</th><th>  { objUserEnquiry.BookedToDate.ToShortDateString()}</th><th> {objUserEnquiry.BookedFromTime}</th><th> {objUserEnquiry.BookedToTime}</th><th>{objUserEnquiry.BookingStatus}</th></tr></table>");
             str.Append($"<p>This is an automatically generated message to confirm receipt of your Booking via the Internet.You do not need to reply to this e - mail, but you may wish to save it for your records.<br/>Thank you.</p>");
             str.Append($"<br/>WarmRegards,<br/> SupportTeam");
             GmailHelper.Send(objUserEnquiry.EmailId, "Regarding TeacherBooking", str.ToString());
         }
         DbHelper.UpdateUserEnquiry(objUserEnquiry);
         return(View("Index"));
     }
     return(View(objUserEnquiry));
 }