================================================ ================================================ How To Use Mailer Client ================================================ ================================================ As the package installed, it has set up some config data in the .config file. You should review it and fill the right values for your project. At the end of this readme file, you can find a realy simple example to use the Mailer Client. ================================================ I - .config settings ================================================ ------------------------------------------------ I - A - config section ------------------------------------------------ A section group was added : ++++++++++++++++++++++++++++++++++++++++++++++++ + + + +
+ + ++++++++++++++++++++++++++++++++++++++++++++++++ Please don't change anything to this part. ------------------------------------------------ I - B - Service Model Endpoint ------------------------------------------------ An endpoint is set for the client to call the service. ++++++++++++++++++++++++++++++++++++++++++++++++ + + + + + + + + + + + ++++++++++++++++++++++++++++++++++++++++++++++++ Here, change the value of the address attribute of the endpoint node, to target the good service. You should only have to change the server name (replace "serverName" by the right value). ------------------------------------------------ I - C - Additional settings ------------------------------------------------ Here, we have the options for the mailer client. ++++++++++++++++++++++++++++++++++++++++++++++++ + + + + + True + + + + + + False + + + + ++++++++++++++++++++++++++++++++++++++++++++++++ - MockMailerService This value is set to true by default. This boolean value specifies if you want to bypass the service call. The client do not even try to reach the service. This is especially usefull if you have no access to the service yet. Set this to true when you want to test that the mail is delivered (being carefull on the mail destination). - MockExceptionOnSend This value is set to False by default. This boolean value specifies if the client must throw an exception on the "Send" method call. When set to True, every call to "Send()" throw a System.ServiceModel.EndpointNotFoundException Hence, nothing is sent nor stored. - RerouteToSpecificMailbox This value is empty by default. You can add here a valid Email that will replace any value indicated in the "to" parameter of the methods : SendMail(MailFormat format, string from, string[] to, ...) SendMail(MailFormat format, string from, string to, ...) The initial Email or Email list is appended to the end of the mail body, as a reminder. ================================================ II - Simple Sample ================================================ Here is a working example for using the mailer client : ++++++++++++++++++++++++++++++++++++++++++++++++ using System; public class MailerClientExample { public void SendAMail() { // first choose your mail format (html or text) Vcf.Services.Mailer.Contracts.MailFormat mailFormat = Vcf.Services.Mailer.Contracts.MailFormat.Text; String from = ""; // put here a sample working address String to = ""; // put here a sample working address String title = "a sample mail title"; String body = "a sample mail body"; // instantiate the client Vcf.Services.Mailer.Client.MailerClient client = new Vcf.Services.Mailer.Client.MailerClient(); // then send the mail client.SendMail(mailFormat, from, to, title, body); // and you are done. } } ++++++++++++++++++++++++++++++++++++++++++++++++