This function sends an email message.

Function Group Execution Windows Embedded Thin Client Mobile Access
SendEmail Email Synchronous Supported Supported Supported Executed on Server


  SendEmail( strSubject, strMessage, strTo )  
Web Studio Help 2fr function email sendemail.xml d114486e125 SendEmail
The subject of the email.
The message body of the email, up to 255 characters long.
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


Before you can send any email, you must first configure your project’s email settings either by using the E-mail Settings dialog or by calling the CnfEmail function. Incorrect settings can result in several different error codes (see “Returned value” above).

Also, SendEmail cannot be used when encryption via TLS/SSL is enabled or to send an email that contains Unicode characters. Use the SendEmailExt function instead.


  SendEmail( "Hi!", "How are you?", "" )  
  SendEmail( statusSummary, statusDetail, adminAddress )