For Programmers: Free Programming Magazines  


Home > Archive > Tcl > December 2007 > Sending email with multi-line subject in tcl









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]

 

Author Sending email with multi-line subject in tcl
mike

2007-12-18, 4:30 am

Is it possible to send email using tcl with multi-line subject encoded
in base64?
Andreas Leitgeb

2007-12-18, 8:16 am

mike <mikezmontesines@gmail.com> wrote:
> Is it possible to send email using tcl with multi-line subject encoded
> in base64?


Multi-line subject for mail? That sounds like an oxymoron to me.
Roy Terry

2007-12-18, 7:20 pm

Andreas Leitgeb wrote:
> mike <mikezmontesines@gmail.com> wrote:
>
> Multi-line subject for mail? That sounds like an oxymoron to me.

Sounds unusual but possible to me.
What feature/lack of feature in the mime library do you think
is stopping you?
mike

2007-12-23, 4:32 am

On Dec 18, 8:36 pm, Roy Terry <r...@terryhome.org> wrote:
> Andreas Leitgeb wrote:
>
>
> Sounds unusual but possible to me.
> What feature/lack of feature in the mime library do you think
> is stopping you?


I need to send email with subject in arabic encoding. Before I send
the email, I have converted the subject to base64 encoding (based on
http://www.faqs.org/rfcs/rfc2047.html). The problem is whenever I
insert a new line, the succeeding characters wasn't inserted on the
subject field but instead I'm seeing it on the email content body.
Btw, I'm using ns_sendmail of openacs

Thanks
Ralf Fassel

2007-12-23, 7:21 pm

* mike <mikezmontesines@gmail.com>
| I need to send email with subject in arabic encoding. Before I send
| the email, I have converted the subject to base64 encoding (based on
| http://www.faqs.org/rfcs/rfc2047.html). The problem is whenever I
| insert a new line, the succeeding characters wasn't inserted on the
| subject field but instead I'm seeing it on the email content body.

You need to insert a whitespace character after the newline.
See rfc2822, Internet Message Format, topic '2.2.3. Long Header Fields'.

HTH
R'
Andreas Leitgeb

2007-12-23, 7:21 pm

mike <mikezmontesines@gmail.com> wrote:
> I need to send email with subject in arabic encoding. Before I send
> the email, I have converted the subject to base64 encoding (based on
> http://www.faqs.org/rfcs/rfc2047.html). The problem is whenever I
> insert a new line, the succeeding characters wasn't inserted on the
> subject field but instead I'm seeing it on the email content body.
> Btw, I'm using ns_sendmail of openacs


Αh, you mean the newlines added by base64...

Two ways:
generate base64 without the newlines, or remove all the whitespace
from the base64-string. It's insignificant for base64, anyway.
add spaces after each newline. I think, that indented lines are
considered continuations of the previous header.

Anyway, only two subsequent newlines end the header-section, so what
I'd have rather expected would have been a crippled subject, and some
illegally formatted unexpected lines in the header. Perhaps you added
another newline after the final one from bse64.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com