AddAttachment Method



 
The AddAttachment method adds an attachment to the email.


Syntax

    EmailJob.AddAttachment(file)
Parameters
    file String that specifies the absolute path of the file.
Return Value
    None.
Remarks
    The parameter must be the absolute path of a file. Use slash instead of backslash in the path string.
Examples
    The following example sends a file attached to an email.

    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    mymail = SiteKiosk.Email.CreateJob(false);
    mymail.POPServer = "mypopserver.com";
    mymail.POPPort = 110;
    mymail.Username = "myusername";
    mymail.Password = "mypassword";
    mymail.SMTPServer = "mysmtpserver.com";
    mymail.SMTPPort = 25;
    mymail.Authentication = 2;
    mymail.SetSender("me@myserver.com", "My name");
    mymail.AddRecipient("recipient@server.com");
    mymail.AddAttachment("c:/myfile.dat");
    mymail.Subject = "This is the subject.";
    mymail.PlainBody = "This is the content.";
    mymail.Send(0, false, true);
    </SCRIPT>
    

Applies to
    SiteKiosk v5.0 (and later versions).

Back to top