sending emails from gmail with c++ code -


i'm interested in sending emails c++ code.

so far i've tried using jwsmtp library @ jwsmtplib , haven't had real success. suggestions? below code:

//code: #include <iostream> #include <jwsmtp/jwsmtp.h>  using std::cout; using std::endl;  int main(  ) {  std::vector<char> vec; std::string mess("foo\nbar"); for(std::string::size_type = 0; < mess.length( ); ++i)   vec.push_back(mess[i]);   jwsmtp::mailer mail("me@gmail.com",              // mail                   "sme@gmail.com",              // mail                   "there room foobar",  // subject email                   vec,                                // content of message                   "smtp.gmail.com",             // smtp server mail           465,      //jwsmtp::mailer::smtp_port, // default smtp port (25)                   false);                             // not query mx records  mail.username("me@gmail.com"); mail.password("mepassword");   //mail.authtype(jwsmtp::mailer::plain); mail.send();  return 0; } 

i'm open other libraries or classes, i'm constraint os x.

i've download poco library i've seen mentioned in other threads, prefer have flatter learning curve. if has example code poco appreciate getting look.

thanks

check out vmime library!


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -