public void SendEmailWithAttachments() { const string endpointConfigurationName = "EmailPusherService_basicHttpBinding"; IEmailPusherService emailPusher = new EmailPusherServiceClient(endpointConfigurationName); var recipients = new string[1] { "*****@*****.**" }; var attachments = new string[1] { @"\\pbsw23it\it\1.jpg" }; var response = emailPusher.AddNewMessageGetAddNewMessageResponse(recipients, null, attachments, "subject", "body", "*****@*****.**"); // user this runs under probably wont hava access to file so error is correct, shows web services is working correctly Assert.That(response.ErrorList[0], Is.EqualTo(@"File Doesnt Exist : \\pbsw23it\it\1.jpg")); }
public void SendEmailWithoutAttachments() { const string endpointConfigurationName = "EmailPusherService_basicHttpBinding"; IEmailPusherService emailPusher = new EmailPusherServiceClient(endpointConfigurationName); var recipients = new string[1] { "*****@*****.**" }; var attachments = new string[0]; var response = emailPusher.AddNewMessageGetAddNewMessageResponse(recipients, null, attachments, "subject", "body", "*****@*****.**"); // user this runs under probably wont hava access to file so error is correct, shows web services is working correctly Assert.That(response.MessageId, Is.GreaterThan(0)); }
public void Send(RazorEmailResult email) { var sr = new StreamReader(email.Mail.AlternateViews[0].ContentStream); var body = sr.ReadToEnd(); email.Mail.AlternateViews[0].ContentStream.Position = 0; const string endpointConfigurationName = "EmailPusherService_basicHttpBinding"; IEmailPusherService emailPusher = new EmailPusherServiceClient(endpointConfigurationName); Log4NetHelper.Log.Debug("EmailSenderHelper EmailPusherServiceClient Binding : " + endpointConfigurationName); emailPusher.AddNewMessageGetAddNewMessageResponse(email.Mail.To.Select(x => x.Address).ToArray(), new string[0], new string[0], email.Mail.Subject, body, email.Mail.From.Address ); Log4NetHelper.Log.Info("EmailSenderHelper Send Completed For Email : " + string.Join(";", email.Mail.To.Select(x => x.Address) )); }