cau vsetci
nepoznate nahodou niekto VMime? mam taky maly problem, nefunguje mi to :-))). dam cisto modelovu situaciu:
bool hociakaTrieda::mailMneSamemu(string & chyba) {
bool nav = false;
vmime::platform::setHandler<vmime::platforms::posix::posixHandler>();
try {
vmime::messageBuilder mb;
mb.setExpeditor(vmime::mailbox("nieco@NeviemNic.com"));
vmime::addressList to;
to.appendAddress(vmime::create <vmime::mailbox>("NeviemNic@gmail.com"));
mb.setRecipients(to);
vmime::addressList bcc;
bcc.appendAddress(vmime::create <vmime::mailbox>("staraMama@karibik.com"));
mb.setBlindCopyRecipients(bcc);
mb.setSubject(vmime::text("Dolezita sprava od sameho seba."));
mb.getTextPart()->setText(vmime::create <vmime::stringContentHandler>("Ahoj ja. Mas sa dobre, ak ano posli mne sebe naspat mail."));
vmime::ref <vmime::message> msg = mb.construct();
string str = "smtp://smtp.gmail.com:587";
vmime::utility::url url(str);
vmime::ref<vmime::net::session> ses = vmime::create<vmime::net::session>();
vmime::ref<vmime::net::transport> tr = ses->getTransport(url, 0);
tr->connect();
tr->send(msg);
tr->disconnect();
nav = true;
}
catch (vmime::exception & e) {
nav = false;
err = " ";
err = e.what();
}
catch (...) {
nav = false;
err = "Nechce sa mi ti odoslat mail.";
}
return nav;
}
Pri pouziti tejto pseudo funkcie mi stale vyhadzuje chybu: Error while executing command 'MAIL'. Chyba je samozrejme z exception. Neviem kde moze byt chyba, skusal som davat prec z url port, ale robi stale to iste. Velmi by mi pomohla asi kazda rada. dik