<eng.sharif@gma il.comwrote in message
news:1172914240 .167747.62430@6 4g2000cwx.googl egroups.com...
>
hi group
>
>
how i can send mail and attachement in php with "mail function "
>
$s = mail($to,$subje ct,$cont, $headers);
>
>
can anyone help
>
thanx
>
Here is a function that I got from someone here:
function mail_attachment ($from , $to, $subject, $message, $attachment){
$fileatt = $attachment; // Path to the file
$fileatt_type = "applicatio n/octet-stream"; // File Type
$start= strrpos($attach ment, '/') == -1 ? strrpos($attach ment, '//') :
strrpos($attach ment, '/')+1;
// Filename that will be used for the file as the attachment
$fileatt_name = substr($attachm ent, $start, strlen($attachm ent));
$email_from = $from; // Who the email is from
$email_subject = $subject; // The Subject of the email
$email_txt = $message; // Message that the email has in it
$email_to = $to; // Who the email is to
$headers = "From: ".$email_fr om;
$file = fopen($fileatt, 'rb');
$data = fread($file,fil esize($fileatt) );
fclose($file);
//$msg_txt="\n\nM ail created using free code from 4word systems :
http://4wordsystems.co m";
hi group
>
>
how i can send mail and attachement in php with "mail function "
>
$s = mail($to,$subje ct,$cont, $headers);
>
>
can anyone help
>
thanx
>
Check out phpmailer <http://phpmailer.sourc eforge.net/>. It will make
your life much easier :-)
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attgl obal.net
=============== ===
Comment