Hi,
I have to call exim from within a C++ function to send email to admin in case of any server errors.
I am calling exim as follow
reporterror.err file contains the error description.
adminemail is the email of the admin to whom the message is being send and fromemail is the email from field.
The actual mail command after substitution of all the variables above looks something like this
This works fine, when I am redirecting the .err for message body, however I want to put the error description in a string and then pass that string as message body to exim.
Since I an not very familiar with exim, can anyone give me the command for passing a string as a message body while calling exim as above.
Thanks,
Tewari
I have to call exim from within a C++ function to send email to admin in case of any server errors.
I am calling exim as follow
Code:
string mailcmd = "/usr/sbin/exim -bnq -f ";
string sym = "<";
string errfilename = "/local/tmpfile/reporterror.err";
string mcmd = mailcmd + " " + adminemail + " "+ fromemail + " " + sym + " "+ errfilename;
systemCallExec = mcmd.c_str();
system(systemCallExec);
adminemail is the email of the admin to whom the message is being send and fromemail is the email from field.
The actual mail command after substitution of all the variables above looks something like this
Code:
/usr/sbin/exim -bnq -f reports@abc.com admin@abc.com < /local/tmpfile/reporterror.err
Since I an not very familiar with exim, can anyone give me the command for passing a string as a message body while calling exim as above.
Thanks,
Tewari