SendEmail
System function, Web function.
The SendEmail function sends an email using the SMTP outgoing mail server defined in WinTask Scheduler email notification Tab. Not available in WinTask Lite.
Syntax
SendEmail(<From>,<To>,<Subject>,<Message_text>[,<Attachments>[,<Cc>]])
or
ret=SendEmail(<From>,<To>,<Subject>,<Message_text>[,<Attachments>[,<Cc>]])Parameters
<From>: string, email address of the email sender.
<To>: string, email name of the recipient.
<Subject>: string, message title.
<Message_text>: string, body part of the message. The maximum length for the body part as a simple string is 80 characters, for a longer body text, use a file : if the first character of the string is the ! character, the message is the content of the file specified by the filename after this ! character.
<Attachments>: string, one or several filenames to attach (the ; character is the separator if several files are specified). If the first character is the ! character, the unique filename specified behind this character is used to send all the files which are listed line by line in this metafile.
<Cc>: string, email name of other recipient.
Return value
Ret, numeric return code. The function returns 0 if successfull, 1 if any error occurred trying to send mail. You can use this return code for Error Handling.
Examples
Send a simple email.
SendEmail("info@wintask.com","order@wintask.com","Meeting today","The meeting today is at 8 am")
Send a longer email witht the body text in a file.
SendEmail("info@wintask.com","order@wintask.com","Read this","!C:\bodymail.txt")
Send an email with attachments listed in a metafile text file.
c:\metafileemail.txt for example lists
c:\test1.txt
c:\test2.txt
c:\test3.txt
c:\program files\wintask\scripts\my_scrip.src
The SendEmail line below sends as attached files the 4 files above.SendEmail("info@wintask.com","order@wintask.com","Test metafile","Please save the attached files","!C:\metafileemail.txt")