Problem sending mail with tcllib/smtp and mime 
Author Message
 Problem sending mail with tcllib/smtp and mime

Maybe I am making some stupid mistake, but the following code
seems to work under windows, but not under linux:

------
package require mime
package require smtp

set msg [mime::initialize -canonical text/plain \
        -param {charset iso-8859-1} \
        -string "Test..."]
mime::setheader $msg Subject Test

smtp::sendmessage $msg -servers localhost \


catch {smtp::finalize $msg}
----

On Windows against a remote SMTP server, it works (using correct addresses, of course).
On Linux against the local SMTP server, it fails with the following error:

key message-id not in header
    while executing
"error "key $mixed not in header""
    ("default" arm line 5)
    invoked from within
"switch -- $key {
        "" {
            set result ""
            foreach lower $state(lowerL) mixed $state(mixedL) {
                lappend result..."
    (procedure "mime::getheader" line 7)
    invoked from within
"mime::getheader $part ${message-idL} "
    invoked from within
"smtp::sendmessage $msg -servers localhost \
    -header [list To ] \

It seems that there are headers missing. I thought sendmessage would add
all necessary headers? Why not in this case and how can I get thsi to work?

--
Rene Hartmann



Sat, 28 Feb 2004 06:19:47 GMT  
 Problem sending mail with tcllib/smtp and mime

Quote:

>Maybe I am making some stupid mistake, but the following code
>seems to work under windows, but not under linux:

                        .
                        .
                        .
What version of tcllib and Tcl are you using under Linux?
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Sat, 28 Feb 2004 07:43:13 GMT  
 Problem sending mail with tcllib/smtp and mime
here's what i use and it works

set messagetext "xxxx"


package require smtp
package require mime

set message [mime::initialize -canonical text/plain -string $messagetext]

smtp::sendmessage $message -servers xx.xx.xx.xx\
                     -header [list To $to]\
                     -header [list From $from]\
                     -header [list Subject "xxxx"]

mime::finalize $message


Quote:
> Maybe I am making some stupid mistake, but the following code
> seems to work under windows, but not under linux:

> ------
> package require mime
> package require smtp

> set msg [mime::initialize -canonical text/plain \
>         -param {charset iso-8859-1} \
>         -string "Test..."]
> mime::setheader $msg Subject Test

> smtp::sendmessage $msg -servers localhost \


> catch {smtp::finalize $msg}
> ----

> On Windows against a remote SMTP server, it works (using correct

addresses, of course).

- Show quoted text -

Quote:
> On Linux against the local SMTP server, it fails with the following error:

> key message-id not in header
>     while executing
> "error "key $mixed not in header""
>     ("default" arm line 5)
>     invoked from within
> "switch -- $key {
>         "" {
>             set result ""
>             foreach lower $state(lowerL) mixed $state(mixedL) {
>                 lappend result..."
>     (procedure "mime::getheader" line 7)
>     invoked from within
> "mime::getheader $part ${message-idL} "
>     invoked from within
> "smtp::sendmessage $msg -servers localhost \
>     -header [list To ] \

> It seems that there are headers missing. I thought sendmessage would add
> all necessary headers? Why not in this case and how can I get thsi to
work?

> --
> Rene Hartmann



Sat, 28 Feb 2004 14:05:13 GMT  
 Problem sending mail with tcllib/smtp and mime

Quote:

> .
> What version of tcllib and Tcl are you using under Linux?
> --

It's Tcl8.3. I tried both tcllib 0.8 and 1.0.

--
Ren Hartmann



Sun, 29 Feb 2004 01:25:13 GMT  
 Problem sending mail with tcllib/smtp and mime

Quote:

> here's what i use and it works

> set messagetext "xxxx"


> package require smtp
> package require mime

> set message [mime::initialize -canonical text/plain -string $messagetext]

> smtp::sendmessage $message -servers xx.xx.xx.xx\
>                      -header [list To $to]\
>                      -header [list From $from]\
>                      -header [list Subject "xxxx"]

> mime::finalize $message

I tried it, and .. it worked.
I investigated it further, and I found out that it depends on the From: address I use.


(which is not conneted to the internet). If I use a different kind of address, it works.

--
Ren Hartmann



Sun, 29 Feb 2004 02:26:33 GMT  
 Problem sending mail with tcllib/smtp and mime
        ...

Quote:
> > smtp::sendmessage $message -servers xx.xx.xx.xx\
> >                      -header [list To $to]\
> >                      -header [list From $from]\
> >                      -header [list Subject "xxxx"]
        ...

> (which is not conneted to the internet). If I use a different kind of address, it works.

This may be a configuration in your SMTP relay.  If it tries to
verify DNS hosts for From, that may cause a failure with no
internet connection.  If you use some other From that may work
because it doesn't do the verification.  Maybe...

--
  Jeff Hobbs                     The Tcl Guy
  Senior Developer               http://www.ActiveState.com/
        Tcl Support and Productivity Solutions



Sun, 29 Feb 2004 04:20:32 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. problem with tcllib mime/smtp and qmail

2. send mail using SMTP Send Message when mail server is unknown

3. Having trouble getting MIME and SMTP from tcllib to work

4. errors with sending email using mime/smtp package

5. Sending SMTP message from Tcl with attached HTML file using MIME

6. tcllib 1.0 - mime encoding mail attachments

7. tcllib - mime - not handling long mails?

8. Anticipation of problem reports with tcllib MIME

9. Tcllib 0.8 mime problem

10. how to send mail with python using SMTP ?

11. Sent Mail via SMTP-server: strange size limit

12. ezsmtp 1.0 SMTP Mail Sending Library

 

 
Powered by phpBB® Forum Software