//Sending Invitation public void sendMsgInvite(GuestModel _guest, EventModel _event, string pass, int EventID) { EventAddress addres = new EventAddress(); MappingClient add_client = new MappingClient(); addres = add_client.getAddressById(Convert.ToString(_event.EventAddress)); EventHostModel host = new EventHostModel(); HostServiceClient ev_host = new HostServiceClient(); host = ev_host.findhsotbyID(Convert.ToString(_event.HostID)); SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "*****@*****.**"); smtp.EnableSsl = true; MailMessage msg = new MailMessage(); msg.Subject = "Invitation to the " + _event.Name; msg.Body = "Hi " + _guest.NAME + ","; msg.Body += "<tr><td>EventriX would like to invite you to attend the " + _event.Desc + "</td></tr>"; msg.Body += "<tr>"; msg.Body += "<td><img src='" + _event.ImageLocation + "' alt=''/></td>"; msg.Body += "</tr>"; msg.Body += "<tr>"; msg.Body += "<td>" + _event.eDate + "</td>"; msg.Body += "</tr>"; msg.Body += "<tr>"; msg.Body += "<td> Location: " + addres.STREET + ", " + addres.CITY + ", " + addres.PROVINCE + "</td>"; msg.Body += "</tr>"; msg.Body += "<tr>"; //http://localhost:60469/Login.aspx?e_ID= // msg.Body += "<td>To RSVP please <a href='http://*****:*****@gmail.com"; msg.From = new MailAddress(FromAddress); msg.IsBodyHtml = true; try { smtp.Send(msg); } catch (Exception ex) { ex.Message.ToString(); } }
//Sending survey emails to guest public void sendSurvey(string Name, string Email, EventModel _event) { EventAddress addres = new EventAddress(); MappingClient add_client = new MappingClient(); addres = add_client.getAddressById(Convert.ToString(_event.EventAddress)); EventHostModel host = new EventHostModel(); HostServiceClient ev_host = new HostServiceClient(); host = ev_host.findhsotbyID(Convert.ToString(_event.HostID)); SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "*****@*****.**"); smtp.EnableSsl = true; MailMessage msg = new MailMessage(); msg.Subject = "Post Event Survey for " + _event.Name; msg.Body = "Hi " + Name + ","; msg.Body += "<tr><td>On behalf of TNT Eventrix and " + _event.Name + ", we would like to thank you for taking part.</td></tr>"; msg.Body += "<tr>"; msg.Body += "<td>Would you take 3 minutes of your time and complete the very breif survey and help us help you in improving your satisfaction for our next event?</td>"; msg.Body += "</tr>"; msg.Body += "<tr>"; msg.Body += "<td>Kindly <a href='http://*****:*****@gmail.com"; msg.From = new MailAddress(FromAddress); msg.IsBodyHtml = true; try { smtp.Send(msg); } catch (Exception ex) { ex.Message.ToString(); } }