comp.lang.ada
 help / color / mirror / Atom feed
* Sending HTML e-mails
@ 2016-01-24  4:24 John Smith
  2016-01-25  9:37 ` Georg Bauhaus
  0 siblings, 1 reply; 9+ messages in thread
From: John Smith @ 2016-01-24  4:24 UTC (permalink / raw)


Hi,

One thing that I'd like to do in Ada is to send an HTML file and have that 
display as the actual e-mail itself (for example, in Outlook.)  Basically, not as 
an attachment to the e-mail, but inside the message of it.

Here are the steps that I took and the results that I got:
- The first thing I did was have a look at this example:
  http://rosettacode.org/wiki/Send_email#Ada

Where it says message, I entered HTML and my e-mail never got to my Outlook 
Inbox.  The plain text worked though.

- Then, I tried turning HTML code into (which is in a plain HTML file) an 
attachment and then sending that out.  Well, this e-mail did get to where it was 
supposed to get to, but it had an attachment that was an HTML file.  I tried 
something similar in a different programming language and it worked as I've 
previously described.

So, I have this question.  How can I create a plain table in HTML and then send it out?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-01-24  4:24 Sending HTML e-mails John Smith
@ 2016-01-25  9:37 ` Georg Bauhaus
  2016-01-28  3:22   ` John Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Georg Bauhaus @ 2016-01-25  9:37 UTC (permalink / raw)


On 24.01.16 05:24, John Smith wrote:
> So, I have this question.  How can I create a plain table in HTML and then send it out?

Set the MIME type header accordingly.

-- 
"HOTDOGS ARE NOT BOOKMARKS"
Springfield Elementary teaching staff


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-01-25  9:37 ` Georg Bauhaus
@ 2016-01-28  3:22   ` John Smith
  2016-01-28 16:52     ` G.B.
  0 siblings, 1 reply; 9+ messages in thread
From: John Smith @ 2016-01-28  3:22 UTC (permalink / raw)


On Monday, January 25, 2016 at 4:37:28 AM UTC-5, Georg Bauhaus wrote:
> On 24.01.16 05:24, John Smith wrote:
> > So, I have this question.  How can I create a plain table in HTML and then send it out?
> 
> Set the MIME type header accordingly.
> 
> -- 
> "HOTDOGS ARE NOT BOOKMARKS"
> Springfield Elementary teaching staff

It seems that I have started two threads at the same time by accident.

I'm curious, which header should I set?  I've looked over AWS.MIME and tried setting a Data object which is generated by AWS.Response.Build(), but this has not been very fruitful.

Could you please show me a small code example?  It doesn't have to be complete, I can tease out the important details and fill in the required blanks.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-01-28  3:22   ` John Smith
@ 2016-01-28 16:52     ` G.B.
  2016-01-28 16:55       ` G.B.
  0 siblings, 1 reply; 9+ messages in thread
From: G.B. @ 2016-01-28 16:52 UTC (permalink / raw)


On 28.01.16 04:22, John Smith wrote:
> On Monday, January 25, 2016 at 4:37:28 AM UTC-5, Georg Bauhaus wrote:
>> On 24.01.16 05:24, John Smith wrote:
>>> So, I have this question.  How can I create a plain table in HTML and then send it out?
>>
>> Set the MIME type header accordingly.
>>
>> --
>> "HOTDOGS ARE NOT BOOKMARKS"
>> Springfield Elementary teaching staff
>
> It seems that I have started two threads at the same time by accident.
>
> I'm curious, which header should I set?  I've looked over AWS.MIME and tried setting a Data object which is generated by AWS.Response.Build(), but this has not been very fruitful.


I think the response given by Dennis Lee Bieber had some good hints.
A function I found around here has

    Result : AWS.Attachments.List;

and then produces a list of attachments to be the mail body.
It includes these statements:

          Result.Add
            (Name => "SpecificInfo",
             Data => Value (Data => Raw_Input,  --  yes, raw
                            Encode => Base64,
                            Content_Type =>
                              AWS.MIME.Text_Plain & "; charset=UTF-8"));
          Result.Add
            (Name => "GenericInfo",
             Data => Value (Data => Generic_Info,
                            Encode => Base64,
                            Content_Type =>
                              AWS.MIME.Text_Plain & "; charset=UTF-8"));

This may explain some headers, I think, even though that's going to be
a MIME message. Last time I needed to send HTML-only mail was in Perl,
so I don't have this handy for Ada.

(HTML-only mail is certainly what many marketeers seem to want.
The assumption is that HTML gets them better links, with tracking
not too visible. The mail show information before the user has
clicked on some teaser that makes him or her a subject of user
research at the sender's web site. Also, HTML-only mail can rely
on colorful, graphical design as one of the classical
means of persuasion. (Javascript programs would be added, too, if
recipients were ever to start accepting that again in eMail, and
if mail filters wouldn't mark these as spam.))


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-01-28 16:52     ` G.B.
@ 2016-01-28 16:55       ` G.B.
  2016-02-01  3:40         ` John Smith
  0 siblings, 1 reply; 9+ messages in thread
From: G.B. @ 2016-01-28 16:55 UTC (permalink / raw)


On 28.01.16 17:52, G.B. wrote:

> not too visible. The mail show information before the user has
                        does ^ not

> clicked on some teaser that makes him or her a subject of user

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-01-28 16:55       ` G.B.
@ 2016-02-01  3:40         ` John Smith
  2016-02-01  9:06           ` Georg Bauhaus
  0 siblings, 1 reply; 9+ messages in thread
From: John Smith @ 2016-02-01  3:40 UTC (permalink / raw)


On Thursday, January 28, 2016 at 11:55:06 AM UTC-5, G.B. wrote:
> On 28.01.16 17:52, G.B. wrote:
> 
> > not too visible. The mail show information before the user has
>                         does ^ not
> 
> > clicked on some teaser that makes him or her a subject of user

Ok, for some reason my e-mail never got to my Inbox (which I did just for testing.)  I don't know why.  I do this on an intranet.  I'll ask someone who does security for us, if not, I'll just do something like insert a dumb Python script to do the actual sending (which makes me somewhat cringe.)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-02-01  3:40         ` John Smith
@ 2016-02-01  9:06           ` Georg Bauhaus
  2016-02-01 23:11             ` John Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Georg Bauhaus @ 2016-02-01  9:06 UTC (permalink / raw)


On 01.02.16 04:40, John Smith wrote:
> On Thursday, January 28, 2016 at 11:55:06 AM UTC-5, G.B. wrote:
>> On 28.01.16 17:52, G.B. wrote:
>>
>>> not too visible. The mail show information before the user has
>>                          does ^ not
>>
>>> clicked on some teaser that makes him or her a subject of user
>
> Ok, for some reason my e-mail never got to my Inbox (which I did just for testing.)  I don't know why.  I do this on an intranet.  I'll ask someone who does security for us, if not, I'll just do something like insert a dumb Python script to do the actual sending (which makes me somewhat cringe.)
>

It is possible to trace AWS's SMTP communication from within the
Ada program, IIRC, if you'd expect the sender's end as a source of
some formal error.

-- 
"HOTDOGS ARE NOT BOOKMARKS"
Springfield Elementary teaching staff

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-02-01  9:06           ` Georg Bauhaus
@ 2016-02-01 23:11             ` John Smith
  2016-02-02 10:33               ` Georg Bauhaus
  0 siblings, 1 reply; 9+ messages in thread
From: John Smith @ 2016-02-01 23:11 UTC (permalink / raw)


On Monday, February 1, 2016 at 4:06:18 AM UTC-5, Georg Bauhaus wrote:
> On 01.02.16 04:40, John Smith wrote:
> > On Thursday, January 28, 2016 at 11:55:06 AM UTC-5, G.B. wrote:
> >> On 28.01.16 17:52, G.B. wrote:
> >>
> >>> not too visible. The mail show information before the user has
> >>                          does ^ not
> >>
> >>> clicked on some teaser that makes him or her a subject of user
> >
> > Ok, for some reason my e-mail never got to my Inbox (which I did just for testing.)  I don't know why.  I do this on an intranet.  I'll ask someone who does security for us, if not, I'll just do something like insert a dumb Python script to do the actual sending (which makes me somewhat cringe.)
> >
> 
> It is possible to trace AWS's SMTP communication from within the
> Ada program, IIRC, if you'd expect the sender's end as a source of
> some formal error.
> 
> -- 
> "HOTDOGS ARE NOT BOOKMARKS"
> Springfield Elementary teaching staff

Using the returned Status, I managed to get my hands on a Reply_Code.  Then, using the AWS.SMTP.Message function, this is what I got as a reply (while not receiving an e-mail):

"250 Requested mail action okay, completed"

Probably not the most informative piece of text...


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Sending HTML e-mails
  2016-02-01 23:11             ` John Smith
@ 2016-02-02 10:33               ` Georg Bauhaus
  0 siblings, 0 replies; 9+ messages in thread
From: Georg Bauhaus @ 2016-02-02 10:33 UTC (permalink / raw)


On 02.02.16 00:11, John Smith wrote:
> "250 Requested mail action okay, completed"
>
> Probably not the most informative piece of text...

That isn't so bad, as it says that the server has
accepted the mail. Usually, if anything happens as
a consequence of further processing or transport,
you might get a bounce message. Or you might not get
one, if the mail transport system is configured to
be silent about its doings. But, as there is no technical
mail tracking, you'd have to follow its path manually,
i.e., scan all log files, if any, of all MTAs involved,
and of all delivery agents involved at the end.

-- 
"HOTDOGS ARE NOT BOOKMARKS"
Springfield Elementary teaching staff


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-02 10:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-24  4:24 Sending HTML e-mails John Smith
2016-01-25  9:37 ` Georg Bauhaus
2016-01-28  3:22   ` John Smith
2016-01-28 16:52     ` G.B.
2016-01-28 16:55       ` G.B.
2016-02-01  3:40         ` John Smith
2016-02-01  9:06           ` Georg Bauhaus
2016-02-01 23:11             ` John Smith
2016-02-02 10:33               ` Georg Bauhaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox