Home > Archive > Tcl > July 2007 > Smtp speed
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hello,
I would like to use Tcl to start sending email. In evaluating it, I put
together a small
program to do this (from resources on the wiki): It creates mime
attachments,
sends the email, and when it completes successfully, it moves on to the
next
message to send.
The performance is not particularly strong though. It seems to take 1
second to
send a single email message. Am I doing something wrong or is there a
way to
speed things up? Is there an option to keep a connection to a mail
server open
until all messages to that host/server have been sent? (My mail server
is hosted
on the network; perhaps that is the culprit?)
Thanks for any info.
| |
| Michael Schlenker 2007-07-20, 7:14 pm |
| Bart schrieb:
> Hello,
>
> I would like to use Tcl to start sending email. In evaluating it, I put
> together a small
> program to do this (from resources on the wiki): It creates mime
> attachments,
> sends the email, and when it completes successfully, it moves on to the
> next
> message to send.
>
> The performance is not particularly strong though. It seems to take 1
> second to
> send a single email message. Am I doing something wrong or is there a
> way to
> speed things up? Is there an option to keep a connection to a mail
> server open
> until all messages to that host/server have been sent? (My mail server
> is hosted
> on the network; perhaps that is the culprit?)
>
Might be.
Depending on your bandwidth and mail size it just takes some time, just
do an approximation based on the size of the mail and your bandwidth.
The tcllib mime/smtp module is not very fast when it comes to larger
mails, especially with attachments, as the mime blocks have to be built.
For shorter mails it shouldn't take too long.
Michael
| |
|
| Michael Schlenker wrote:
> Might be.
>
> Depending on your bandwidth and mail size it just takes some time, just
> do an approximation based on the size of the mail and your bandwidth.
>
> The tcllib mime/smtp module is not very fast when it comes to larger
> mails, especially with attachments, as the mime blocks have to be built.
> For shorter mails it shouldn't take too long.
>
> Michael
>
I ran the same tests again. I removed the actual message sending code
but I left the mime and attachment creation parts. The difference was
amazing. This leads me to believe that the sendmessage method
of the smtp is the one spending all that time.
Is there a way to make this method more efficient? I have not looked
at its internals yet and would rather not to at this point.
Thanks!
| |
| Gerald W. Lester 2007-07-20, 7:15 pm |
| Bart wrote:
> Michael Schlenker wrote:
>
>
> I ran the same tests again. I removed the actual message sending code
> but I left the mime and attachment creation parts. The difference was
> amazing. This leads me to believe that the sendmessage method
> of the smtp is the one spending all that time.
>
> Is there a way to make this method more efficient? I have not looked
> at its internals yet and would rather not to at this point.
It does not do much, it is most likely as fast as your SMTP host will let
you send mail. Some of them limit how fast you can send mail in an effort
to discourage spammers.
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
|
|
|
|
|