public System.Threading.Tasks.Task SendAsync(IdentityMessage message) { var mm = new MailMessage("*****@*****.**", message.Destination, message.Subject, message.Body) { IsBodyHtml = true, SubjectEncoding = Encoding.UTF8, BodyEncoding = Encoding.UTF8 }; var gmail = TDSettings.DefaultGmail(); var smtp = new SmtpClient() { Host = "smtp.gmail.com", UseDefaultCredentials = false, EnableSsl = true, Port = 25, Credentials = new System.Net.NetworkCredential(gmail.ID, gmail.Key) }; return(smtp.SendMailAsync(mm)); }
public static bool GetNumber(string Number) { var twilio = TDSettings.DefaultTwilio(); Twilio.TwilioClient.Init(twilio.ID, twilio.Key); var callerIds = OutgoingCallerIdResource.Read( phoneNumber: new PhoneNumber(twilio.OtherInformation)); foreach (var callerId in callerIds) { if (callerId.PhoneNumber.ToString() == Number) { return(true); } } return(false); }
public static bool CreateNumber(string Number) { try { var twilio = TDSettings.DefaultTwilio(); Twilio.TwilioClient.Init(twilio.ID, twilio.Key); var phoneNumber = new PhoneNumber(Number); //var tw = new TwilioRestClient(twilio.ID, twilio.Key); //var callerId = tw..AddOutgoingCallerId("+14158675309", "My Home Phone Number", null, null); var validationRequest = ValidationRequestResource.Create( phoneNumber, friendlyName: "Auto AddNumber"); Console.WriteLine(validationRequest.ValidationCode); } catch { } return(true); }