emSendMail() - obsolete
This function allows sending mails.
Using the function emSendMail() in a CTRL-Script, you have to insert the following entry in the config.level of your project before starting the Control Manager:
[ctrl] LoadCtrlLibs = "email.ctl" |
Synopsis
void emSendMail(string smtp_host, string name, dyn_string email, int
&ret);
Parameters
Parameter | Meaning |
---|---|
smtp_host | Host name (IP address) of the SMTP Servers |
name |
Domain name of the client (or IP address). This Parameter identifies the client at the server. |
The dyn_string email contains the mail to be sent: email[1] .... Receiver email[2] .... Sender email[3] .... Subject email[4] .... Message Body |
|
&ret | Contains the return value 0 for OK or -1 for errors. |
Return value
none
Error
An error has a value of -1 for ret. In the case on an error, an internal error message will be displayed.
Description
The function connects to the SMTP server and sends an email based on SMTP. Afterwards, the connection will be closed. If you want to send an email to different recipients, you have to separate the addresses with ";" (for example, "receiver@etm.at;receiver2@etm.at;receiver3@etm.at").
email_cont[4] = "=?ISO-8859-1?Q?=F6=E4=FC?="
will be converted
to "öäü".You have to load the script email.ctl, and make an entry in the [ui] and [ctrl] section of the config.level file: LoadCtrlLibs = "email.ctl".
Do not start Outlook when using the function, because Outlook uses the same functions and could be faster.
Example
main()
{
int ret;
dyn_string email_cont;
//email_cont[1] = "xxx@etm-ag.com"; // either
email_cont[1] = "receiver@etm.at"; // or
email_cont[2] = "sender@etm.at";
email_cont[3] = "Hallo";
email_cont[4] = "Today is the 19.02.2002. How time flies";
// sending the message
//emSendMail ("prj1", "eiwnt004.etm.at", email_cont, ret); //either
emSendMail ("prj1", "193.81.17.4", email_cont, ret); // or
}
Assignment
Communication functions
Availability
CTRL