SendEmail

This function sends an email message.

Function Group Execution Windows Embedded Thin Client
SendEmail Email Synchronous Supported Supported Supported

Syntax

SendEmail(strSubject,strMessage,strTo)
strSubject
The subject of the email.
strMessage
The message body of the email, up to 255 characters long.
strTo
The email address of the intended recipient.

Returned value

Value Description
0 Success
1 Invalid format for strSubject
2 Invalid format for strMessage
3 Invalid format for strTo
4 Wrong number of parameters
5 Start Socket error
6 Error getting host IP Address (i.e., invalid SMTP server)
7 Error connecting to SMTP server
8 Error sending HELO command (i.e., initialization)
9 Error sending MAIL command (i.e., the "From" address)
10 Error sending RCPT command (i.e., the "To" address)
11 Error sending DATA (i.e., the message body)
12 Error sending SMTP authentication command
13 Invalid username
14 Invalid password

Notes

Before you can send any email, you must first use the CnfEmail function to configure the email settings. Incorrect settings can result in several different error codes (see "Returned value" above).

Also, SendEmail cannot be used to send an email that contains Unicode characters. To do that, use the SendEmailExt function instead.

Examples

SendEmail( "Hi!", "How are you?", "rogers@pnd.net" )
SendEmail( statusSummary, statusDetail, adminAddress )