public bool HasFired(IDictionary <string, TriggerParameter> triggerParameters) { var mail = new TcpClient(); mail.Connect("pop.gmail.com", 995); var netStream = new SslStream(mail.GetStream()); // Last thing you need is to authenticate as a client (you are connecting to them so you are the client and they are the server). // You have to pass in the name on their certificate, which so happens to be the same host they are using for connecting. "pop.gmail.com" netStream.AuthenticateAsClient("pop.gmail.com"); var response = ReadResponse(netStream); if (!response.StartsWith("+OK")) { throw new Exception(); } Authenticate(netStream); var param = new TriggerParameter <string> { Name = "email_subject", Value = "test email" }; triggerParameters.Add(param.Name, param); return(true); }
public InvalidTriggerParameterTypeException(TriggerParameter triggerParam, Type expectedType) : base($"Expected parameter of type {expectedType.FullName} but was {triggerParam.Type.FullName} for parameter named {triggerParam.Name}.") { }