public void SendDataInvalidRecipients() { var random = new Random(); byte[] bytes = new byte[23]; random.NextBytes(bytes); MailGun.Send(StringHelper.ValidString(), StringHelper.NullEmptyWhiteSpace(), bytes); }
public Guid Send(BinaryEmail email) { Contract.Requires <ArgumentNullException>(null != email); Contract.Requires <ArgumentOutOfRangeException>(!string.IsNullOrWhiteSpace(email.Sender)); Contract.Requires <ArgumentOutOfRangeException>(!string.IsNullOrWhiteSpace(email.Recipient)); Contract.Requires <ArgumentOutOfRangeException>(null != email.RawMessage); MailGun.Send(email.Sender, email.Recipient, email.RawMessage); var table = new AzureTable <BinaryEmailData>(ServerConfiguration.Default); var data = email.Convert(); table.AddEntity(data); return(data.Id); }
/// <summary> /// This is where we should do the actual email send to the user. /// </summary> /// <param name="to">To Email Address</param> /// <param name="from">From Email Address</param> /// <param name="subject">Title</param> /// <param name="body">Body</param> private void Send(string to, string from, string fromName, string subject, string body) { if (string.IsNullOrWhiteSpace(from)) { throw new ArgumentException("from"); } if (!string.IsNullOrWhiteSpace(to)) { var sent = false; try { var email = new MailGun(); var response = email.Send(from, fromName, to, subject, body); sent = true; //sent = response.StatusCode == System.Net.HttpStatusCode.OK; } catch { } this.Archive(from, fromName, to, subject, body, sent); } }
public void SendData() { MailGun.Send("*****@*****.**", "*****@*****.**", Guid.NewGuid().ToByteArray()); }
public void SendText() { MailGun.Send("*****@*****.**", "*****@*****.**", "This is a test email message", string.Format("this is a test message{0}; which is suppose to have text in it.", StringHelper.ValidString())); }
public void SendDataEmptyMime() { byte[] bytes = new byte[0]; MailGun.Send(StringHelper.ValidString(), StringHelper.NullEmptyWhiteSpace(), bytes); }
public void SendDataNullMime() { MailGun.Send(StringHelper.ValidString(), StringHelper.ValidString(), null); }
public void SendTextNullText() { MailGun.Send(StringHelper.ValidString(), StringHelper.ValidString(), string.Empty, null); }
public void SendTextNullSubject() { MailGun.Send(StringHelper.ValidString(), StringHelper.ValidString(), null, string.Empty); }
public void SendTextInvalidRecipients() { MailGun.Send(StringHelper.ValidString(), StringHelper.NullEmptyWhiteSpace(), string.Empty, string.Empty); }