sending emails

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

sending emails

Post by Happyrever » Sat Jul 07, 2012 7:08 pm

Some while ago I cobbled together a simple email generator to send an all text message.
I now need to send messages as part of a mail shot but to include an image.
The body of the message will consist of a few introductory lines of text, followed by the image and concluding with a goodby text.
I do not wish to send the image as an attachment.
Any ideas how this might be done?

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: sending emails

Post by shaosean » Sat Jul 07, 2012 7:20 pm

You would need to use MIME and put in a HTML part..

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: sending emails

Post by gpb01 » Sat Jul 07, 2012 7:22 pm

Hi,
look on this page : http://www.troz.net/rev/index.irev?category=All and you will find two libraries :

POP_Library_Demo and SMTP_Library_Demo

Maybe can help ...

Guglielmo

Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: sending emails

Post by Happyrever » Sun Jul 08, 2012 10:12 am

shaosean I dont understand your reply, it is beyond my experience.
What does it look like in code, to pick up the image?

gpb01 I have tried these before, but things have moved on and they no longer work.
It is not worth the time to debug the software.

the code i have used in the original text only email sender is:-
on mouseUp
global Addresslines,loop
set the itemDelimiter to tab
put number of lines in field "Address list" into Addresslines

put loop + 1into loop
if item 2 of line loop of field "Address list" <> 1 then
put item 1 of line loop of field "Address list" into field "Message address"
put 1 into item 2 of line loop of field "Address list"
put loop into item 3 of line loop of field "Address list"
put loop into field "counter"
revmail field "Message address",,Field "Subject",field "Message body"
end if
if loop > Addresslines then
answer "end of list"
end if

end mouseUp

So what line do i have to add to pick up the image?

Thanks.

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: sending emails

Post by shaosean » Sun Jul 08, 2012 8:17 pm

Just a quick little recap about the email system:

- SMTP is the network protocol used to send emails, it has no idea about the actual email message format (nor does it really care)
- MIME is an add-on to the email message format that allows you to include attachments and rich text emails, it knows nothing about SMTP

When you compose your message in Rev, you will need to take the text of the field and convert it to a plain text version, as well as a rich text version (usually HTML).. When you have all the parts that you need (including attachments and inline images) you need to build a properly formatted MIME message and then you send that through SMTP (which is the library noted above)..

Now apparently Rev still does not have MIME nor SMTP support, and the SMTP library that is available no longer works, so you will need to roll our own or find another set of libraries to do this for you..

Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: sending emails

Post by Happyrever » Sun Jul 08, 2012 8:36 pm

shaosean
Thank you for your explanation. So I am stuffed.
Why does it not surprise me that Rev is not up to speed!

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: sending emails

Post by shaosean » Mon Jul 09, 2012 6:11 am

In all honesty writing a simple MIME encoder and SMTP socket are not all the difficult.. MIME decoder on the other hand *blargh*

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: sending emails

Post by shaosean » Tue Jul 10, 2012 11:12 am

If you can wait a couple of weeks I can get SMTP and MIME encoding ready for you..

Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: sending emails

Post by Happyrever » Fri Jul 13, 2012 9:32 am

that is very kind, however, with lateral thinking, i have come up with an easier solution.

Post Reply