FreeBSD Manual Pages
jwsmtp(3) EMAIL PROGRAMMING jwsmtp(3) NAME jwsmtp - smtp library in C++ SYNOPSIS #include <jwsmtp/jwsmtp.h> mailer(const char* TOaddress, const char* FROMaddress, const char* Subject, const std::vector<char>& Message, const char* server = "127.0.0.1", unsigned short Port = SMTP_PORT, bool MXLookup = true); mailer(const char* TOaddress, const char* FROMaddress, const char* Subject, const char* Message, const char* server = "127.0.0.1", unsigned short Port = SMTP_PORT, bool MXLookup = true); mailer(bool MXLookup = false, unsigned short Port = SMTP_PORT); void operator()(); void send(); bool attach(const std::string& filename); bool removeattachment(const std::string& filename); bool setmessage(const std::string& newmessage); bool setmessage(const std::vector<char>& newmessage); bool setmessageHTML(const std::string& newmessage); bool setmessageHTML(const std::vector<char>& newmessage); bool setmessageHTMLfile(const std::string& filename); bool setsubject(const std::string& newSubject); bool setserver(const std::string& nameserver_or_smtpserver); bool setsender(const std::string& newsender); bool addrecipient(const std::string& newrecipient, short recipient_type = TO); bool removerecipient(const std::string& recipient); void clearrecipients(); void clearattachments(); void reset(); const static enum {TO, Cc, Bcc, SMTP_PORT = 25, DNS_PORT = 53} consts; enum authtype {LOGIN = 1, PLAIN} type; void authtype(const enum authtype Type); void username(const std::string& User); void password(const std::string& Pass); DESCRIPTION jwSMTP is a C++ library/code to facilitate sending email programmati- cally. send in plain text - html format, attachments, multiple recipi- ents - BCC CC included. LOGIN & PLAIN authentication. Do an MX lookup or send direct via smtp server. EXAMPLES Send an email to root on the machine the program is invoked on. #include <jwsmtp/jwsmtp.h> jwsmtp::mailer m("root", "root", "subject line", "This is the plain text part of the message", "localhost", jwsmtp::mailer::SMTP_PORT, false); m.send(); Send an email to someone@somewhere.net from me@myserver.net. Here we do an MX lookup on somewhere.net using the nameserver ns.thename- server.net #include <jwsmtp/jwsmtp.h> jwsmtp::mailer m("someone@somewhere.net", "me@myserver.net", "subject line", "Hey what's up?", "ns.thenameserver.net"); m.send(); Check whether the mail got sent if(m.response( ).substr(0,3) != "250") { // error, mail not sent } AUTHOR John Wiggins (jw@johnwiggins.net) BUGS version 1.32 June 20, 2004 jwsmtp(3)
NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | AUTHOR | BUGS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=jwsmtp&sektion=3&manpath=FreeBSD+Ports+15.0>
