[PHP] Webmail with Attach

2002-01-08 Thread Luz Lopez

Hi All,

I am making a webmail, this webmail can send with just one attach, but I 
need that that my webmail can send mail with many attach.

Now my function have the follwing code line:

if ($attach != none)
{
$file = fopen($attach, r);
$contents = fread($file, $attach_size);
$encoded_attach = chunk_split(base64_encode($contents));
fclose($file);

//$encoded_attach = base64_encode($attach);\
//$encoded_attach = $attach;

$mailheaders .= MIME-version: 1.0\n;
$mailheaders .= Content-type: multipart/mixed; ;
$mailheaders .= boundary=\Message-Boundary\\n;
$mailheaders .= Content-transfer-encoding: 7BIT\n;
$mailheaders .= X-attachments: $attach_name;

$body_top = --Message-Boundary\n;
$body_top .= Content-type: text/plain; charset=US-ASCII\n;
$body_top .= Content-transfer-encoding: 7BIT\n;
$body_top .= Content-description: Mail message body\n\n;

$msg_body = $body_top . $msg_body;

$msg_body .= \n\n--Message-Boundary\n;
$msg_body .= Content-type: $attach_type; 
name=\$attach_name\\n;
$msg_body .= Content-Transfer-Encoding: BASE64\n;
$msg_body .= Content-disposition: attachment; 
filename=\$attach_name\\n\n;
$msg_body .= $encoded_attach\n;
$msg_body .= --Message-Boundary--\n;
}


How can I do it?

Some body can help me?

Thanks in Advanced,

Regards,

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Webmail with Attach

2002-01-08 Thread Jason Murray

 I need that that my webmail can send mail with many attach.
 How can I do it?

You could either ask the user how many attachments they want,
and present that number of INPUT TYPE=FILE fields, or you
can grab the file attachment from the user, store it in a 
uniquely-named temporary directory, get another, and another, 
and store them all in the temp directory until the user says
right, that's it at which point you read all the files in
your directory and send them as attachments. 

You've got the code right for sending one attachment, sending
mutliples is just another loop in the email assembly code.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Webmail with Attach

2002-01-08 Thread Martin Towell

you just need to loop this part of the code:

  $msg_body .= \n\n--Message-Boundary\n;
  $msg_body .= Content-type: $attach_type; name=\$attach_name\\n;
  $msg_body .= Content-Transfer-Encoding: BASE64\n;
  $msg_body .= Content-disposition: attachment;
filename=\$attach_name\\n\n;
  $msg_body .= $encoded_attach\n;

as many times as there are attachments, obviously, using the next
attachment's content and type for $encoded_attach and $attach_type

and don't do:

  $msg_body .= --Message-Boundary--\n;

until all the attachments have been added

hope that helps
Martin


-Original Message-
From: Luz Lopez [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Webmail with Attach


Hi All,

I am making a webmail, this webmail can send with just one attach, but I 
need that that my webmail can send mail with many attach.

Now my function have the follwing code line:

if ($attach != none)
{
$file = fopen($attach, r);
$contents = fread($file, $attach_size);
$encoded_attach = chunk_split(base64_encode($contents));
fclose($file);

//$encoded_attach = base64_encode($attach);\
//$encoded_attach = $attach;

$mailheaders .= MIME-version: 1.0\n;
$mailheaders .= Content-type: multipart/mixed; ;
$mailheaders .= boundary=\Message-Boundary\\n;
$mailheaders .= Content-transfer-encoding: 7BIT\n;
$mailheaders .= X-attachments: $attach_name;

$body_top = --Message-Boundary\n;
$body_top .= Content-type: text/plain; charset=US-ASCII\n;
$body_top .= Content-transfer-encoding: 7BIT\n;
$body_top .= Content-description: Mail message body\n\n;

$msg_body = $body_top . $msg_body;

$msg_body .= \n\n--Message-Boundary\n;
$msg_body .= Content-type: $attach_type; 
name=\$attach_name\\n;
$msg_body .= Content-Transfer-Encoding: BASE64\n;
$msg_body .= Content-disposition: attachment; 
filename=\$attach_name\\n\n;
$msg_body .= $encoded_attach\n;
$msg_body .= --Message-Boundary--\n;
}


How can I do it?

Some body can help me?

Thanks in Advanced,

Regards,

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



[PHP] Webmail with attach

2002-01-05 Thread Luz Lopez

Hi all,

I am making a small webmail, But I need that this webmail have attach, I can 
to put one attach athis mail, but I need many attach in the webmail, I made 
a bucle for many attach, but now I can't to manipulate this attach for that 
the user send mail with many attach.

Some body can help me?

Thanks in advanced,

Regards



_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Webmail with Attach

2002-01-05 Thread Luz Lopez

Hi All,

I am making a webmail, this webmail can send with just one attach, but I 
need that that my webmail can send mail with many attach.

Now my function have the follwing code line:

if ($attach != none)
{
$file = fopen($attach, r);
$contents = fread($file, $attach_size);
$encoded_attach = chunk_split(base64_encode($contents));
fclose($file);

//$encoded_attach = base64_encode($attach);\
//$encoded_attach = $attach;

$mailheaders .= MIME-version: 1.0\n;
$mailheaders .= Content-type: multipart/mixed; ;
$mailheaders .= boundary=\Message-Boundary\\n;
$mailheaders .= Content-transfer-encoding: 7BIT\n;
$mailheaders .= X-attachments: $attach_name;

$body_top = --Message-Boundary\n;
$body_top .= Content-type: text/plain; charset=US-ASCII\n;
$body_top .= Content-transfer-encoding: 7BIT\n;
$body_top .= Content-description: Mail message body\n\n;

$msg_body = $body_top . $msg_body;

$msg_body .= \n\n--Message-Boundary\n;
$msg_body .= Content-type: $attach_type; 
name=\$attach_name\\n;
$msg_body .= Content-Transfer-Encoding: BASE64\n;
$msg_body .= Content-disposition: attachment; 
filename=\$attach_name\\n\n;
$msg_body .= $encoded_attach\n;
$msg_body .= --Message-Boundary--\n;
}


How can I do it?

Some body can help me?

Thanks in Advanced,

Regards,

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]