On 4/8/2020 6:09 PM, Brian Adkins wrote:

Thanks for the info George. Are you feeding that entire template (after substituting the @ variables) into the smtp-send-message function as the message argument i.e. a list of lines?

Yes.

I'm also curious about having "subject" in the template vs. the header.

History.  When I first did this (many years ago) there was an issue with /standard-message-header/  screwing up the line breaks, and the resulting message being formatted incorrectly if there was a non-empty subject string.

I am sure this has long been fixed, but at the time I started constructing my own header strings using /insert-field/  from the net/head library.  Message[*] headers can be in any order - they need only to precede the body - so it didn't really matter where the subject line came from, and since the subjects were static for most of my messages, it was simplest to just put them into the message templates.

[*] Note that embedded MIME multipart headers DO have defined order.


I take it from your reply there isn't already something in existence that streamlines this process in a similar way to a framework such as Rails.

Don't get me started on Rails  8-(  Makes easy things easy and hard things damn near impossible.


There's nothing in Racket for MIME that I'm aware of ... but then multipart formatting is needed only for multi-version messages, or for embedding non-text data (graphics, etc.) into a message.   Since so many people read mail in web browsers, and most offline clients handle HTML, I don't think many people even bother with multi-version messages any more.  Sending plain HTML is as easy as sending plain text.

Multipart formatting is recursive and parts can be nested arbitrarily, so handling it all properly could be complicated given the need to integrate with other code generating the message body (HTML, etc.) within.  It's doable ... I just never got the urge to tackle it.

George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/93536d3e-28be-bb37-4ad1-e92d29a573c5%40comcast.net.

Reply via email to