Hi!
Is there a possibilty to use the sendmail-procedure (resources site) to send a mail with an attached file? The sendmail procedure only sends the message subject and the message body.
--
Greetings, Martin.
Sendmail with attached file
Yes, you can use the Base64Encoder() function to add everything to your mails bodies. Attachements are just Base64 (or other) encoded files directely included as ascii in your mail body.
You will also need to use the multipart/mixed content type, and Boundary to build your mail.
Any mailler can show you the source of a mail, look at a source with an attachment to really see how to use multipart/mixed content type and Boundary (not very complicated).
You will also need to use the multipart/mixed content type, and Boundary to build your mail.
Any mailler can show you the source of a mail, look at a source with an attachment to really see how to use multipart/mixed content type and Boundary (not very complicated).
Thank You For Your answer.Mr Skunk wrote:Yes, you can use the Base64Encoder() function to add everything to your mails bodies. Attachements are just Base64 (or other) encoded files directely included as ascii in your mail body.
Can You perhaps give an example how to code this? It's difficult for me to understand how the Base64Encoder() works with files.
--
Greetings,
Martin.
Re: Sendmail with attached file
I saw a lot of conflicting stories about sending mail with attachments, so in
the end I just downloaded "Blat" (a command line mailer) and included it in
my app as a binary. I can then send mail using the RunProgram command.
You can download it from here:
http://www.interlog.com/~tcharron/blat.html
It is totally legal to use Blat in your own apps this way as it has been placed
in the Public Domain and its own docs state (in part): "you can use it free
of charge for any purpose you like [...] You have permission to modify,
redistribute, hoard, or even sell Blat in its executable or source form [...]"
Just remember to compress its exe before IncludeBinary'ing it into your app,
to keep the inclusion small. (It's not that large, anyway). Also, it's a good
idea to rename it from Blat.exe to YourApp.exe so that any firewalls will
refer to it by your app's name, so that your users don't panic and wonder
why an app called "Blat.exe" is trying to access the Internet.
Maybe one day someone will post some good (working) sendmail code to
these forums, that supports attachments, so Blat doesn't have to be used.
the end I just downloaded "Blat" (a command line mailer) and included it in
my app as a binary. I can then send mail using the RunProgram command.
You can download it from here:
http://www.interlog.com/~tcharron/blat.html
It is totally legal to use Blat in your own apps this way as it has been placed
in the Public Domain and its own docs state (in part): "you can use it free
of charge for any purpose you like [...] You have permission to modify,
redistribute, hoard, or even sell Blat in its executable or source form [...]"
Just remember to compress its exe before IncludeBinary'ing it into your app,
to keep the inclusion small. (It's not that large, anyway). Also, it's a good
idea to rename it from Blat.exe to YourApp.exe so that any firewalls will
refer to it by your app's name, so that your users don't panic and wonder
why an app called "Blat.exe" is trying to access the Internet.

Maybe one day someone will post some good (working) sendmail code to
these forums, that supports attachments, so Blat doesn't have to be used.