Sarah's SMTP email attachment problem

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
jeffe
Posts: 40
Joined: Thu Sep 27, 2007 12:09 am

Sarah's SMTP email attachment problem

Post by jeffe » Thu May 09, 2013 11:45 pm

Hi All,

Love the forum, I have been reading and learning quite a lot thanks to you guyz.
Keep up the great work.

I have an issue which I have NOT been able to work out. I'm hoping someone might
be able to help with this one.

I am using Sarah's SMTP email library. It work's great !!!
I only have one issue, when sending an attachment - I constantly get a second attached file.
This file is a text file named "Untitled attachment 001**" the stars being random numbers.

There is nothing in it when opened and it is only a 127kb, but nether the less I don't want people
receiving emails thinking that there might be a virus attached to the email.

Is this normal or a bug?
Can I alter the script in any way to stop this from happening?


Thanks in advanced...

jeffe

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

Re: Sarah's SMTP email attachment problem

Post by shaosean » Fri May 10, 2013 10:11 pm

sounds like a bug.. i am waiting for the next version of droptools to be released and will be releasing some new controls for it, one of them being a SMTP control..

jeffe
Posts: 40
Joined: Thu Sep 27, 2007 12:09 am

Re: Sarah's SMTP email attachment problem

Post by jeffe » Thu May 16, 2013 5:23 am

Hi Shaosean,

Great to hear about the new version of droptools having a SMTP control.
Will it also be able to send attachments?

Going back to the original request - Is anyone else having the same issue as I am?
I am currently going through the code, trying to eliminate the problem so I will post an update if I succeed.


jeffe

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

Re: Sarah's SMTP email attachment problem

Post by shaosean » Thu May 16, 2013 5:51 am

send me an email from your program and i will take a look to see if i can help out (that extra attachment might be being added from a server extension).. i can also go through your code for you if you would..

i am just waiting for ken to post the update to droptools and then will finish my testing and release some new drops for it.. the smtp drop is strictly a smtp socket, but i will be converting my old mime encoder to something a little more object oriented than it was previously..

jeffe
Posts: 40
Joined: Thu Sep 27, 2007 12:09 am

Re: Sarah's SMTP email attachment problem

Post by jeffe » Thu May 16, 2013 11:54 am

Hi Shaosean,

Love to send you an email and I'm sure it's staring me right in the eye.
BUT, my question is...

What is your email address?

I will use Sarah's SMTP Stack, it will contain 1 PDF as this is what I would normally send.
and I will also attach Sarah's SMTP stack or you can download it from her website
and try it for yourself.


Thanks for you assistance.

jeffe

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

Re: Sarah's SMTP email attachment problem

Post by shaosean » Thu May 16, 2013 9:33 pm

support AT shaosean DOT tk

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

Re: Sarah's SMTP email attachment problem

Post by shaosean » Fri May 17, 2013 6:25 am

I did reply via email, but thought I would post on here for others who might have the same issue.. It seems that there are some errors in the MIME encoding and the boundaries are not being closed..

jeffe
Posts: 40
Joined: Thu Sep 27, 2007 12:09 am

Re: Sarah's SMTP email attachment problem

Post by jeffe » Fri May 17, 2013 12:02 pm

Sorry,

Just got in from a busy day.
I did get your email. Is there any way to fix this problem.

jeffe

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

Re: Sarah's SMTP email attachment problem

Post by shaosean » Fri May 17, 2013 7:47 pm

would have to look through the code to see where a boundary should be closed.. to close a boundary you just need to append "--" to the boundary markers she is already using..

jeffe
Posts: 40
Joined: Thu Sep 27, 2007 12:09 am

Re: Sarah's SMTP email attachment problem

Post by jeffe » Sat May 18, 2013 2:31 am

Hi All,

It took 10 SECONDS to work out but only
after Shaosean handy tip to append "--"

I don't know if the line changed it the correct one but after some testing
some might say (stinky) - personal joke, those who know will understand.
it actually works. No more "Untitled attachment"

For those who are interested,
Open Sarah's SMTP Library Demo
In the Card "sSMTPlibrary" line 159 change it from...

Put "" & CRLF after emailText to Put "--" & CRLF after emailText



Thanks again to Shaosean & this excellent forum.



jeffe

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

Re: Sarah's SMTP email attachment problem

Post by shaosean » Sat May 18, 2013 3:22 am

yeah, you made my iphone stink ;-) but seriously, i am glad to hear that it is working for you..

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Sarah's SMTP email attachment problem

Post by istech » Fri May 30, 2014 2:09 pm

Hi All,
I wonder if anyone can help. First of all sorry to bring up such a old thread but the issues are related.

I have been playing with Sarahs SMTP script and have had some success using it. This problem

only happens with attahchments. As mentioned above the library has problems with MiME encoding

which is corrupting the headers of my attachments. I have tried serveral attachments, If I make the modification above

I get the error "500, lines exceeded the limit" (probably related to the bounderies). Or if I remove the modification the files come through corrupted

saying (if pdf) "Adobe Reader could not open (etc) either file type not supported or the files was damaged" (Could be related to MIME encoding) Has any experienced

member managed to have a go at fixing it or am I doing something wrong on my end, if there is a different lib available I would love to hear about it. Thanks All
Last edited by istech on Sun Jun 01, 2014 7:29 am, edited 1 time in total.

istech
Posts: 211
Joined: Thu Sep 19, 2013 10:08 am

Re: Sarah's SMTP email attachment problem

Post by istech » Sun Jun 01, 2014 6:45 am

Managed to get the lib working with credit to Mark and John for this post: http://mail.on-rev.com/forums/viewtopic ... 38&p=96535

I have attached my fixed modified version to save anyone time looking for a solution to the above problems with the library.

Emails with any size attachment now work with this lib.

This will save someone a headache. :D


ps. The update is more of a patch than a fix. The hidden cause is a lone CR LF on construction of the body. But with Marks code it checks the output and sorts the issue. I have also made a few tweaks here and there.
Attachments
SMTP_library_.zip
(19.65 KiB) Downloaded 291 times

Post Reply