That's arcane. 8)
PHPMailer - that's easy! 8)
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Joe Makowiec" <makowiec@invalid.invalid> wrote in
message
news:Xns98576D05C7A09makowiecatnycapdotrE@216.104.212.96...
> On 09 Oct 2006 in macromedia.dreamweaver.appdev, Murray
*ACE* wrote:
>
>> I want to send an email with a file attachment.
>>
>> Is there an easy way to do this, or is it as arcane
as I think it is?
>
> php.net knows all, tells all:
>
> Note: Email with attachments and special types of
content (e.g.
> HTML) can be sent using this function. This is
accomplished via
> MIME-encoding - for more information, see this Zend
article or the
> PEAR Mime Classes.
>
>
http://www.php.net/manual/en/function.mail.php
>
> Refers to:
>
> Zend article:
http://www.zend.com/zend/spotlight/sendmimeemailpart1.php
> PEAR Mime classes:
http://pear.php.net/package/Mail_Mime
>
> But the short version:
> - encode the attachment. This is normally done for you
by your mail
> client; it's easy enough to find software to do it. You
can even
> convince PHP to do it on the fly.
> - create the message as mime-encoded:
> Mime-Version: 1.0
> Content-Type: multipart/mixed;
> boundary="=====================_100756562==_"
> - Add your text
> - Add a boundary:
> --=====================_100756562==_
> - Add your mime-encoded content:
> Content-Type: image/jpeg; name="glynn.jpg";
> x-mac-type="4A504547"; x-mac-creator="4A565752"
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename="glynn.jpg"
>
>
/9j/4AAQSkZJRgABAgEBLAEsAAD/7QE0UGhvdG9zaG9wIDMuMAA4QklNA+
> 0AAAAAABABLAAAAAEA
> [snip - a couple hundred lines of a picture of my
cousin-in-law]
>
>
NMokXJxiPRPvNZto/J/DTEWeNVIlnU0LPQci4ahr8xlXUW3y2ieF+c+tmQ6jeeqvF/WfkKg9/bN5
> i5PL6i+LdLBTjv0ybU4gUap2pvXAppD706b4Wp//2Q==
> - And finally, terminate the attachment:
> --=====================_100756562==_--
>
> I'd build this step-by-step, thus:
>
> <?php
> $message = "Mime-Version: 1.0\nContent-Type:
>
multipart/mixed;\nboundary=\"=====================_100756562==_\"\n";
> $message .= "Here's the file you requested\n\n";
> $message .= "--=====================_100756562==_\n";
> $message .= $encodedFileFromSomewhereElse; . "\n"
> $message .= "--=====================_100756562==_\n";
> // Continue creating the message
> // ...
> ?>
>
> Example message, created by Eudora, snagged off my
server as a raw
> message:
>
> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0
> Date: Mon, 09 Oct 2006 10:28:32 -0400
> To: joe@example.org
> From: Joe Makowiec <makowiec@example.com>
> Subject: Mime-encoded message
> Mime-Version: 1.0
> Content-Type: multipart/mixed;
> boundary="=====================_100756562==_"
>
> --=====================_100756562==_
> Content-Type: text/plain; charset="us-ascii";
format=flowed
> Text content goes here
>
>
> Joe
>
> --=====================_100756562==_
> Content-Type: image/jpeg; name="glynn.jpg";
> x-mac-type="4A504547"; x-mac-creator="4A565752"
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename="glynn.jpg"
>
>
/9j/4AAQSkZJRgABAgEBLAEsAAD/7QE0UGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABABLAAAAAEA
> [snip]
>
NMokXJxiPRPvNZto/J/DTEWeNVIlnU0LPQci4ahr8xlXUW3y2ieF+c+tmQ6jeeqvF/WfkKg9/bN5
> i5PL6i+LdLBTjv0ybU4gUap2pvXAppD706b4Wp//2Q==
> --=====================_100756562==_--
>
> --
> Joe Makowiec
>
http://makowiec.net/
> Email:
http://makowiec.net/email.php