...
// creating "note" option
it.mailupnet.services.Option optNote = new it.mailupnet.services.Option();
optNote.Key = "note";
optNote.Value = "This is a short message description";
// attaching a file to the message
// 1. Reading the message and content base 64 encoding
FileStream fs = new FileStream(@"C:\mydir\webservice.docx",FileMode.Open, FileAccess.Read);
byte[] filebytes = new byte[fs.Length];
fs.Read(filebytes, 0, Convert.ToInt32(fs.Length));
string encodedData = Convert.ToBase64String(filebytes,Base64FormattingOptions.InsertLineBreaks);
// 2. Creating "attach01_name" option containing the filename
it.mailupnet.services.Option optAttach01Name = new it.mailupnet.services.Option();
optAttach01Name.Key = "attach01_name";
optAttach01Name.Value = "test.docx";
// 3. Creating "attach01_data" option containing the file content
it.mailupnet.services.Option optAttach01Data = new it.mailupnet.services.Option();
optAttach01Data.Key = "attach01_data";
optAttach01Data.Value = encodedData;
// creating the array of sending options
it.mailupnet.services.Option[] options = new it.mailupnet.services.Option[3];
options[0] = optNote;
options[1] = optAttach01Name;
options[2] = optAttach01Data;
string html = "this is message content (HTML body of message to be sent)";
string s = myService.CreateNewsletter(accessKey, 1, "WebService // Newsletter da HTML", "HTML", html, options);
...Â
if (errorCode == 0)
{
// Enter here if method call is successful and received response can be parsed
}