Jump to content

email with attachment Solved with our thanks in the final post


niche

Recommended Posts

how do I send an email with an attachment called test.png? I don' understand the ref at http://php.net/manua...ction.mail.php. Script so far:

<?php$from = "info@lin.com";$to = "nihe@neb.rr.com";$subject = "Test";$message = "1234567890";$headers = "From: $from\r\n";$headers .= "Content-type: text/html\r\n";mail($to, $subject, $message, $headers);?>

Link to comment
Share on other sites

you will need to send appropiate header for that file type. and after that you will need to parse the file and encode it in base64 delimiting by new line character as it does not exceed 70 characters. mail server are tend to pass ascii characters so you will need to base64 convert binary file when you will send.if you need to send it as attatchment with text or other file type you will need to set its header multipart/mixeda good example is herehttp://au.php.net/manual/en/function.mail.php#105661

Link to comment
Share on other sites

thanks for your help birbal & justsomeguy. I'll look at the PEAR solution as soon as I can.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...