Author |
Topic: SMTP (Read 1417 times) |
|
Nanne
New Member
member is offline


Posts: 9
|
 |
Re: SMTP
« Reply #5 on: Oct 23rd, 2012, 10:44pm » |
|
Is it possible to send a file using the socklib library. And If so how I have to do that?
I tried:
IF FN_writelinesocket(skt%, "Attach: "+"test.txt")
But it didn't work.
Nanne
|
| « Last Edit: Oct 23rd, 2012, 10:45pm by Nanne » |
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: SMTP
« Reply #6 on: Oct 24th, 2012, 08:20am » |
|
on Oct 23rd, 2012, 10:44pm, Nanne wrote:| Is it possible to send a file using the socklib library. |
|
I assume from the context that you are referring to attaching a file to an email (rather than uploading it to an FTP server, for example). Is that right?
If an FTP upload is acceptable then this article tells you how to do it: http://bb4w.wikispaces.com/Uploading+files+to+an+FTP+server
Richard.
|
|
Logged
|
|
|
|
Nanne
New Member
member is offline


Posts: 9
|
 |
Re: SMTP
« Reply #7 on: Oct 24th, 2012, 09:20am » |
|
Hi Richard,
Sorry, I was not clear in my question.
I want to attach a file (PDF) with my email-message.
I have read the documentation about FTP but my users (the receivers) can't use FTP So I have to attach a file to a message.
So, my question is: Is it possible to attach af file with using the socklib library?
Thank you,
Nanne
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: SMTP
« Reply #8 on: Oct 24th, 2012, 09:43am » |
|
on Oct 24th, 2012, 09:20am, Nanne wrote:| Is it possible to attach af file with using the socklib library? |
|
Certainly it is "possible", but I'm not aware of anybody having done it before. You would need to create a multipart MIME email including the attachment, suitably encoded (e.g. as 'base64'). There is some useful information on what is needed here:
http://www.codeguru.com/cpp/i-n/internet/email/article.php/c3405/EMail-File-Attachments-Using-MIME.htm
At a quick glance it looks quite easy. Let us know how you get on (and ideally write a Wiki article - or even a BB4W library - for the benefit of others).
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: SMTP
« Reply #9 on: Oct 24th, 2012, 5:30pm » |
|
on Oct 24th, 2012, 09:43am, Richard Russell wrote:| At a quick glance it looks quite easy. |
|
In fact so easy I couldn't think of a good reason not to write it myself - so I did:
http://bb4w.wikispaces.com/Sending+an+email+with+attachments
It hasn't been extensively tested but appears to work. Let me know if you have any problems with it.
Richard.
|
|
Logged
|
|
|
|
Nanne
New Member
member is offline


Posts: 9
|
 |
Re: SMTP
« Reply #10 on: Oct 24th, 2012, 11:12pm » |
|
Hi Richard,
Thank you for your work!
I'll try it this week and let you know if I have problems with it. When it works fine, which I assume, I let you know that too 
Nanne
|
|
Logged
|
|
|
|
|