combit List & Label 27 - .NET Help
combit.Reporting Namespace / MailJob Class / AdditionalOptions Property


In This Topic
    AdditionalOptions Property
    In This Topic

    Allows to define some additional mail options e.g. for sending via SMTP.

    These options can be found in the Programmer's Reference for "Export.Mail..." (see also chapter '7.5.2 Setting Mail Parameters by Code').

    Syntax
    'Declaration
     
    
    Public ReadOnly Property AdditionalOptions As Dictionary(Of String,String)
    public Dictionary<string,string> AdditionalOptions {get;}
    public:
    property Dictionary<String^,String^>^ AdditionalOptions {
       Dictionary<String^,String^>^ get();
    }
    Example

    Shows sending mail via the SMTP protocol.

    // Instantiate mail job
    MailJob mailJob = new MailJob();
    
    // Set options
    mailJob.AttachmentList.Add(@"<Path>\report.pdf");
    mailJob.To = "info@combit.net";
    mailJob.Subject = "Here is the report";
    mailJob.Body = "Please note the attachment.";
    mailJob.ShowDialog = true;
    
    // Set SMTP options
    mailJob.Provider = "SMTP";
    mailJob.AdditionalOptions.Add("Export.Mail.SMTP.ServerAddress", "<ServerAddress>);
    mailJob.AdditionalOptions.Add("Export.Mail.SMTP.ServerUser", "<ServerUser>");
    mailJob.AdditionalOptions.Add("Export.Mail.SMTP.ServerPassword", "<ServerPassword>");
    
    // Send mail
    mailJob.Send();
    mailJob.Dispose();
    
    ' Instantiate mail job
    Dim mailJob As New MailJob()
    
    ' Set options
    mailJob.AttachmentList.Add("<Path>\report.pdf")
    mailJob.To = "info@combit.net"
    mailJob.Subject = "Here is the report"
    mailJob.Body = "Please note the attachment."
    mailJob.ShowDialog = True
    
    ' Set SMTP options
    mailJob.Provider = "SMTP"
    mailJob.AdditionalOptions.Add("Export.Mail.SMTP.ServerAddress", "<ServerAddress>)
    mailJob.AdditionalOptions.Add("Export.Mail.SMTP.ServerUser", "<ServerUser>")
    mailJob.AdditionalOptions.Add("Export.Mail.SMTP.ServerPassword", "<ServerPassword>")
    
    ' Send mail
    mailJob.Send()
    mailJob.Dispose()
    

    One more sample for sending mail is shown here: Sending mail.

    Requirements

    Platforms: Windows 8.1, Windows 10 (Version 1909 - 21H2), Windows 11 (21H2), Windows Server 2012 - 2022

    See Also