private void button6_Click(object sender, EventArgs e) { IEmailProvider emailProvider = Palaso.Email.EmailProviderFactory.PreferredEmailProvider(); IEmailMessage message = emailProvider.CreateMessage(); message.To.Add("*****@*****.**"); message.AttachmentFilePath.Add("/etc/hosts"); message.Subject = "Test Message"; message.Body = "Just a test message.\nWith more than one\nor two lines"; message.Send(emailProvider); }
private void btnSend_Click(object sender, EventArgs e) { try { // TODO: This can be moved out to the caller rather than in the UI. _emailMessage.Send(_emailProvider); } catch { //swallow it } DialogResult = DialogResult.OK; Close(); }
static void Main(string[] args) { IMobileMessage mobile = Factory.GetMobileMessage(); mobile.WriteMessage("Hello how are you? This is a sms marketing, do you wanna buy something?"); mobile.AddRecipient("+39-319-555-7749685"); mobile.AddRecipient("+39-320-555-7828092"); mobile.Send(); Console.WriteLine(); IEmailMessage email = Factory.GetEmailMessage(); email.WriteMessage("Please this is an e-mail verification."); email.AddSubject(); email.AddAttach(); email.AddRecipient("*****@*****.**"); email.AddRecipient("*****@*****.**"); email.AddRecipient("*****@*****.**"); email.RequestReadReceipt(); email.Send(); Console.ReadLine(); }