public MailgunHttpRequest(IMailgunAccountInfo accountInfo, string method, string relativePath)
		{
			request = WebRequest.Create(new Uri(accountInfo.DomainBaseUrl, relativePath)) as HttpWebRequest;
			request.Method = method;

			// Note: ensure no preceding 401, request.PreAuthenticate does not work as you might expect
			request.Headers.Add("Authorization", "basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(String.Format("api:{0}", accountInfo.ApiKey))));
		}
示例#2
0
        public MailgunHttpRequest(IMailgunAccountInfo accountInfo, string method, string relativePath)
        {
            request        = WebRequest.Create(new Uri(accountInfo.DomainBaseUrl, relativePath)) as HttpWebRequest;
            request.Method = method;

            // Note: ensure no preceding 401, request.PreAuthenticate does not work as you might expect
            request.Headers.Add("Authorization", "basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(String.Format("api:{0}", accountInfo.ApiKey))));
        }
示例#3
0
 public CreateRouteCommand(IMailgunAccountInfo accountInfo, int priority, string description, RouteFilter expression, params RouteAction[] actions)
     : base(accountInfo, "../routes")
 {
     this.priority    = priority;
     this.description = description;
     this.expression  = expression;
     this.actions     = actions;
 }
示例#4
0
        public MailgunHttpRequest(IMailgunAccountInfo accountInfo, string method, string relativePath, int timeout = 100000)
        {
            request         = (HttpWebRequest)WebRequest.Create(new Uri(accountInfo.DomainBaseUrl, relativePath));
            request.Method  = method;
            request.Timeout = timeout;

            // Note: ensure no preceding 401, request.PreAuthenticate does not work as you might expect
            request.Headers.Add("Authorization", "basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes($"api:{accountInfo.ApiKey}")));
        }
示例#5
0
 public SendMailCommand(IMailgunAccountInfo accountInfo, MailMessage mailMessage)
     : base(accountInfo, "messages")
 {
     this.mailMessage = mailMessage;
 }
示例#6
0
 public DeleteCommand(IMailgunAccountInfo accountInfo, string path) : base(accountInfo, path, "DELETE")
 {
 }
示例#7
0
 protected MailgunCommand(IMailgunAccountInfo accountInfo, string path, string httpVerb = "POST") : base(accountInfo, path, httpVerb)
 {
 }
示例#8
0
 public MailgunRouteQuery(IMailgunAccountInfo accountInfo) : base(accountInfo, "../routes")
 {
 }
示例#9
0
		public DeleteCommand(IMailgunAccountInfo accountInfo, string path) : base(accountInfo, path, "DELETE") { }
示例#10
0
 public SendMailCommand(IMailgunAccountInfo accountInfo, MailMessage mailMessage)
     : base(accountInfo, "messages")
 {
     this.mailMessage = mailMessage;
 }
示例#11
0
 protected MailgunQuery(IMailgunAccountInfo accountInfo, string path)
 {
     this.path   = path;
     AccountInfo = accountInfo;
 }
示例#12
0
 public MailgunStatsQuery(IMailgunAccountInfo accountInfo, MailgunEventTypes eventTypes) : base(accountInfo, "stats")
 {
     this.eventTypes = eventTypes;
 }
示例#13
0
 public CreateMailboxCommand(IMailgunAccountInfo accountInfo, string account, string password) : base(accountInfo, "mailboxes")
 {
     this.account  = account;
     this.password = password;
 }
示例#14
0
 public SendMailCommand(IMailgunAccountInfo accountInfo, MailMessage mailMessage, IDictionary <string, IDictionary <string, object> > recipientVariables)
     : base(accountInfo, "messages")
 {
     this.mailMessage    = mailMessage;
     _recipientVariables = recipientVariables;
 }
示例#15
0
 protected MailgunCommand(IMailgunAccountInfo accountInfo, string path, string httpVerb = "POST")
 {
     this.path     = path;
     this.httpVerb = httpVerb;
     AccountInfo   = accountInfo;
 }
		public CreateMailboxCommand(IMailgunAccountInfo accountInfo, string account, string password) : base(accountInfo, "mailboxes")
		{
			this.account = account;
			this.password = password;
		}
示例#17
0
 public MailgunMailboxQuery(IMailgunAccountInfo accountInfo) : base(accountInfo, "mailboxes")
 {
 }