Trouble trying to send an email



Hi All,

So now I'm trying to send an email (thank you again for helping to
successfully receive emails from an IMAP Gmail account using SSL -
works great now!) - I'm trying something really simple, ripping off
parts of the "msg-sender.c" sample program.

I have a "create_test_msg" function that looks like this:

// defines
#define TEST_STRING "This is a test email from Steve Rosen"
#define HTML_PRE "<html><body><b>"
#define HTML_POST "</b></body></html>"

static TnyMsg*
create_test_msg ()
{
    TnyMsg * msg_to_send = (TnyMsg *)tny_camel_msg_new ();
    TnyHeader *header = tny_msg_get_header (msg_to_send);

    TnyStream *plain_stream = tny_camel_mem_stream_new ();
    TnyStream *html_stream = tny_camel_mem_stream_new ();
    TnyMimePart *plain_body = tny_camel_mime_part_new ();
    TnyMimePart *html_body = tny_camel_mime_part_new ();

    tny_header_set_subject (header, TEST_STRING);
    tny_header_set_from (header, "rosens us panasonic com");
    tny_header_set_to (header, "steverosen polarlight com");

    g_object_unref (G_OBJECT (header));

    tny_stream_write (plain_stream, TEST_STRING, strlen (TEST_STRING));
    tny_stream_reset (plain_stream);

    tny_stream_write (html_stream, HTML_PRE TEST_STRING HTML_POST, strlen (HTML_PRE TEST_STRING HTML_POST));
    tny_stream_reset (html_stream);

    tny_mime_part_construct (plain_body, plain_stream, "text/plain; charset=utf-8", "7bit");
    tny_mime_part_construct (html_body, html_stream, "text/html; charset=utf-8", "7bit");

    tny_mime_part_add_part (TNY_MIME_PART (msg_to_send), html_body);
    tny_mime_part_add_part (TNY_MIME_PART (msg_to_send), plain_body);

    g_object_unref (G_OBJECT (plain_stream));
    g_object_unref (G_OBJECT (html_stream));

    g_object_unref (G_OBJECT (plain_body));
    g_object_unref (G_OBJECT (html_body));

    return (msg_to_send);
}


And I have a TRANSPORT store account all setup to use SMTP to send
the message.  So the really simple code looks like this:

    // create a test message...
    TnyMsg * msg = create_test_msg ();

    // send the test message...
    TnySendQueue * queue = tny_camel_send_queue_new (TNY_CAMEL_TRANSPORT_ACCOUNT (account));
    tny_send_queue_add (queue, msg, &l_err);


Then I just call the "gtk_main()" function to see if the test message
gets sent - but nothing happens...  :(

In gdb, I put a break at the "smtp_connect" function, but it never
gets called...

Using a similar SMTP account that I setup in Tmut, the "smtp_connect"
function DOES get called (although it fails to successfully connect
to my Comcast SMTP server - but that's my next question!)...

So, any thoughts on what is wrong?

And now that I mentioned Tmut - as I just mentioned, the smtp_connect
call gets made in Tmut, but it fails to authenticate with the Comcast
SMTP server (smtp.comcast.net) - for the Tmut account that I create,
what is the correct way to configure the account so it does the correct
authentication?  I can telnet to smtp.comcast.net and enter this:

telnet smtp.comcast.net 25
helo auth
auth login
<base64 encoded username>
<base64 encoded password>
data
... (etc.)

So how do you configure a Tmut SMTP account to exchange the correct
authentication conversation with the Comcast SMTP server?

Thank you again for any advice/wisdom regarding my questions - I know
it will be some simple and trivial change that allows me to successfully
send an email message - and then I can start the REAL project (creating
a C++ wrapper library to provide a really simple class to my client
applications for sending and receiving emails.

Sincerely,
Steve Rosen


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]