Hi i tried this script to test sending mail with vmime :
vmime::platform::setHandler<vmime::platforms::posix::posixHandler>();try{vmime::messageBuildermb;//Fillinsomeheaderfieldsandmessagebodymb.setSubject(vmime::text("Message Subject"));mb.setExpeditor(vmime::mailbox("xxx"));mb.getRecipients().appendAddress(vmime::create<vmime::mailbox>(vmime::string("slim.it.tn@gmail.com")));mb.getTextPart()->setCharset(vmime::charsets::UTF_8);mb.getTextPart()->setText(vmime::create<vmime::stringContentHandler>("This is the text of your message..."));//Messageconstructionvmime::ref<vmime::message>msg=mb.construct();// //Outputrawmessagedatatostandardoutput// vmime::utility::outputStreamAdapterout(std::cout);// msg->generate(out);//Createanewsessionvmime::utility::urlurl("smtp://smtp.gnet.tn");vmime::ref<vmime::net::session>sess=vmime::create<vmime::net::session>();//Createaninstanceofthetransportservicevmime::ref<vmime::net::transport>tr=sess->getTransport(url);//Connectittr->connect();//Sendthemessagetr->send(msg);//Wehavefinishedusingtheservicetr->disconnect();}//VMimeexceptioncatch(vmime::exception&e){std::cerr<<"vmime::exception; "<<e.what()<<std::endl;}//Standardexceptioncatch(std::exception&e){std::cerr<<"std::exception: "<<e.what()<<std::endl;}
and at execution it gives me this error :
vmime::exception; Error while executing command 'RCPT TO': slim.it.tn@gmail.com.
so, do you see what the problem is ?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here, the vmime::exception should actually be of type vmime::exceptions::command_error, and you can get more information about the issue (ie. the actual response from the server).
Have a look at the exception helper in "example6".
Vincent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
here is the complete error :
**
* vmime::exceptions::command_error
what = Error while executing command 'RCPT TO': slim.it.tn@gmail.com.
command = RCPT TO
response = 5.7.1 <hb_elec@gnet.tn>: Sender address rejected: not logged in
terminate called after throwing an instance of 'vmime::exceptions::command_error'
what(): Error while executing command 'RCPT TO': slim.it.tn@gmail.com.
**
and here is my code :
vmime::messageBuildermb;//Fillinsomeheaderfieldsandmessagebodymb.setSubject(vmime::text("Message Subject"));mb.setExpeditor(vmime::mailbox("hb_elec@gnet.tn"));mb.getRecipients().appendAddress(vmime::create<vmime::mailbox>(vmime::string("slim.it.tn@gmail.com")));mb.getTextPart()->setCharset(vmime::charsets::UTF_8);mb.getTextPart()->setText(vmime::create<vmime::stringContentHandler>("This is the text of your message..."));//Messageconstructionvmime::ref<vmime::message>msg=mb.construct();//Createanewsessionvmime::utility::urlurl("smtp://hbelec:hb2154@smtp.gnet.tn");vmime::ref<vmime::net::session>sess=vmime::create<vmime::net::session>();//Createaninstanceofthetransportservicevmime::ref<vmime::net::transport>tr=sess->getTransport(url);//Connectittr->connect();//Sendthemessagetr->send(msg);//Wehavefinishedusingtheservicetr->disconnect();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
je suis entrain de développer une application propriétaire et si tout marche bien je compte acheter vMime. Mais le problème est que ça marche sur linux mais pas sur windows. Trop de problème de compilation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
but terminal show: terminate called after throwing an instance of 'vmime::exceptions::certificate_verification_exception'
what(): Cannot verify certificate against trusted certificates.
Aborted (core dumped)
What wrong in here?
Last edit: TuanNN 2013-12-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi i tried this script to test sending mail with vmime :
and at execution it gives me this error :
vmime::exception; Error while executing command 'RCPT TO': slim.it.tn@gmail.com.
so, do you see what the problem is ?
Thanks.
Hello!
Here, the vmime::exception should actually be of type vmime::exceptions::command_error, and you can get more information about the issue (ie. the actual response from the server).
Have a look at the exception helper in "example6".
Vincent
Thank you,
here is the complete error :
**
* vmime::exceptions::command_error
what = Error while executing command 'RCPT TO': slim.it.tn@gmail.com.
command = RCPT TO
response = 5.7.1 <hb_elec@gnet.tn>: Sender address rejected: not logged in
terminate called after throwing an instance of 'vmime::exceptions::command_error'
what(): Error while executing command 'RCPT TO': slim.it.tn@gmail.com.
**
and here is my code :
I don't understand why i'm not logged in.
The correct hostname is : smtp.gnet.tn
authentification is activate(clear) :
login: hb2154
password: hb2154
sender address is : hb_elec@gnet.tn.
i tried to send with evolution using this informations and it succeeds to send.
Thanks.
slimittn.
sorry,
login: hbelec
Hello,
Try this:
tr->setProperty("options.need-authentication", true);
before calling tr->connect().
Regards,
Vincent
Hi,
i have also tried this as in the vmime book.
Vincent,
je suis entrain de développer une application propriétaire et si tout marche bien je compte acheter vMime. Mais le problème est que ça marche sur linux mais pas sur windows. Trop de problème de compilation.
I have same error when connecting to gmail, this i my code:
vmime::platform::setHandler<vmime::platforms::posix::posixHandler>();
vmime::utility::url url("imaps://[user]:[pass]@imap.gmail.com:993");
vmime::ref<vmime::net::session> session(vmime::create<vmime::net::session>());
vmime::ref <vmime::net::store> store = session->getStore(url);
store->setProperty("options.need-authentication", true);
printf("connecting..\n");
store->connect();
but terminal show: terminate called after throwing an instance of 'vmime::exceptions::certificate_verification_exception'
what(): Cannot verify certificate against trusted certificates.
Aborted (core dumped)
What wrong in here?
Last edit: TuanNN 2013-12-05