#include <jwsmtp/jwsmtp.h>
int main(int argc, char* argv[])
{
jwsmtp::mailer m("root", "root", "subject line", "message body", "localhost", jwsmtp::mailer::SMTP_PORT, false);
m.send( );
std::cout << m.response( ) << "\n";
return 0;
}
If this was a file called
myemailer.cpp to compile it
into a working program, run the command:
g++ myemailer.cpp -o myemailer `pkg-config --libs --cflags jwsmtp-<version>`
where
<version> is the latest
version of jwSMTP without the <> symbols.
JohnWiggins.net
email me about