I dont know what I should name the PHP’s. Also I have the one that is an application and it looks great, whats the html to add a file upload box? Once that is done I need to create another PHP like a miler.php, but im type confused. So all I have to do is edit the mailer php? So then what is the actual code for it then?
This is it, but its really confusing.
[QUOTE]
$mime_boundary = “<<<–==+X[“.md5(time()).”]”;
Sort out your basic headers as usual, by piling them into a $headers string.
$headers .= “From: Automatic <
$headers .= “To: SomeName <
Then you’ve got to specify the type of content you’re dealing with. This is also put into the $headers string. In this case, it will be mixed between text, and some kind of attachment, hence the Content-Type bit. The boundary bit uses the boundary variable you made earlier:
$headers .= “MIME-Version: 1.0rn”;
$headers .= “Content-Type: multipart/mixed;rn”;
$headers .= ” boundary=””.$mime_boundary.”””;
Next, get on with piling the message into a $message string. You need quite a bit of header looking stuff in here. The first bit is what is displayed if the client receiveing the email doesn’t support MIME, followed by the boundary string (preceded by “–“, not sure why).
$message .= “This is a multi-part message in MIME format.rn”;
$message .= “rn”;
$message .= “–“.$mime_boundary.”rn”;
Next comes the actual content of the email, each part needs it’s own mini header describing what it is.
$message .= “Content-Type: text/plain; charset=”iso-8859-1″rn”;
$message .= “Content-Transfer-Encoding: 7bitrn”;
$message .= “rn”;
$message .= “Email content and what not: rn”;
$message .= “This is the file you asked for! rn”;
$message .= “–“.$mime_boundary.”rn”;
Finally, a plaintext attachment. In this case I already put your contents into $fileContent.
$message .= “Content-Type: application/octet-stream;rn”;
$message .= ” name=”filename.extn”rn”;
$message .= “Content-Transfer-Encoding: quoted-printablern”;
$message .= “Content-Disposition: attachment;rn”;
$message .= ” filename=”filename.extn”rn”;
$message .= “rn”;
$message .= $fileContent;
$message .= “rn”;
$message .= “–“.$mime_boundary.”rn”;
Then send the thing, using the mail function as described in the manual. You will probably have to have a few goes at this before you get it right. The linbreaks need to be exactly right for this to work, and if it doesn’t, that’s probably why.
$ok = mail(“