how do i attach a file to an email?
is there a FILE part of the header or something like that after DATA ??
also, as it's sent as plain text how do i send an .exe or something like that?
thx.
skud.
I don't know much about it, but I think your mail should be created according to the MIME standard (probably somewhere at rfc-editor.org).
Binary data is base64 encoded iirc, ascii is just sent like normal text. To get an example, write a mail in a program that can view the source (outlook express can).
Thomas
thanks for the reply!
of course i have had a look at the souce in outlook express ...
with an .asm text attachement to the email it comes up as a weird code. they're all printable ascii (i think). how do i encode it to this format or do i have to send it in a different way or something???
skud.
RFC 2045 describes the MIME standard, section 6.8 is about base64 en/decoding.
I think outlook express encodes asm file because it fails to recognize asm files are text files, probably due to it's extension.
Thomas
skud,
I assume you already know how to
connect to the mail server and send the
HELO www.mailsever.com
then you send the mail from:
MAIL FROM:
then to who:
RCPT TO:
then to send the message you would send
DATA
From: "Zcoder"
To: "Zcoder"
Subject: a program file.
Date: Tue, 19 Jun 2001 10:56:22 -0500
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_000F_01C0F8AE.7A434200"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
This is a multi-part message in MIME format.
------=_NextPart_000_000F_01C0F8AE.7A434200
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0010_01C0F8AE.7A434200"
------=_NextPart_001_0010_01C0F8AE.7A434200
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
just a program file.
------=_NextPart_001_0010_01C0F8AE.7A434200
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
just a program =
file.
------=_NextPart_001_0010_01C0F8AE.7A434200--
------=_NextPart_000_000F_01C0F8AE.7A434200
Content-Type: application/x-msdownload;
name="about.exe"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="about.exe"
Now just send the file about.exe
then end it ith this:
------=_NextPart_000_000F_01C0F8AE.7A434200--
then send the crlf,".",crlf
then send the:
QUIT
I hope this helps.