error on command: RCPT TO

Help
btx
2011-02-19
2013-04-25
  • btx
    btx
    2011-02-19

    Hi,
    I'm starting with vmime and i receive an exception on RCPT TO when a send my mail.

    I tried to give my username/password in the session and in the transport, but the error still theire.
    I'm not even sure this cause the probleme
    could you help me.       

    here is the code

    mb.setExpeditor(vmime::mailbox("me@somewhere.com"));

                    vmime::addressList to;
                    to.appendAddress(vmime::create <vmime::mailbox>("my_username@free.fr"));

                    mb.setRecipients(to);

                    vmime::addressList bcc;
                    bcc.appendAddress(vmime::create <vmime::mailbox>("you-bcc@nowhere.com"));

                    mb.setBlindCopyRecipients(bcc);

                    mb.setSubject(vmime::text("My first message generated with vmime::messageBuilder"));

                   
                    mb.getTextPart()->setText(vmime::create <vmime::stringContentHandler>(
                            "I'm writing this short text to test message construction " \
                            "using the vmime::messageBuilder component."));

                    // Construction
                    vmime::ref <vmime::message> msg = mb.construct();

                    vmime::string msgTxt = msg->generate();

                    session_out->getProperties()="my_username";
                    session_out->getProperties()="my_password";
                    session_out->getProperties()=cServerOutName;   /* init = smtp.free.fr */

                    std::string std_str  = "smtp://";
                    std_str += cServerOutName;  
    //               vmime::utility::url url( std_str);
                    vmime::utility::url url( "smtp://my_username:my_password@smtp.free.fr");
                    vmime::ref <vmime::net::transport> tr =
                                    session_out->getTransport(url);
                //    tr->service::setProperty("options.need-authentification",true);
                    tr->service::setProperty("auth.username", "my_username");
                    tr->service::setProperty("auth.password","my_password");
                    tr->connect();
                    tr->send( msg);            <-- execption is thrown here

    here the message'header and the exception

    subject: My first message generated with vmime::messageBuilder
    From: me@somewhere.com
    To: spamyessai1@free.fr
    Bcc: you-bcc@nowhere.com
    Date: Sat, 19 Feb 2011 00:52:59 +0100
    Mime-Version: 1.0
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: quoted-printable

    I'm writing this short text to test message construction using the vmime:=
    :messageBuilder component.

    -->VIME Exception Error while executing command 'RCPT TO'

    thanks.