[PHP] Attachments and SendMail()

2005-11-08 Thread Todd Cary
I have had to move an application for a client from a dedicated server 
to a shared server.  On the dedicated server, the path to the 
attachements was an absolute address of


/home/sites/home/web/php/images/raceschd.pdf;

and all worked fine when I gave that as the location of the attachement:

if ($Attachment) {
  $mail-AddAttachment($Attachment);
}

Now I am not sure where/how to specify the location of the attachment. 
If anyone has experience with a shared server, I would appreciate any help.


The URL to the site is

http://64.202.163.82/s/f/y/sfycadmin/html/

And with FTP that is the base or root.  I have tried putting the file in 
that directory, but SendMail() does not appear to connect to it.


Todd

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Attachments with Mail()

2003-10-23 Thread Don Mc Nair
Hi

Can anyone tell me how to add a file as an attachment to an email sent with
something like the following ?

 $headers = From: .$fromaddress.\r\n;
 $headers .= Reply-To: $fromaddress\r\n;
   mail($toaddress, $subject, $mailcontent, $headers);

Thanks
Don


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.529 / Virus Database: 324 - Release Date: 16/10/2003

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Attachments with Mail()

2003-10-23 Thread Evan Nemerson
PEAR has a class which may be helpful.

http://pear.php.net/package/Mail_Mime




On Thursday 23 October 2003 04:13 am, Don Mc Nair wrote:
 Hi

 Can anyone tell me how to add a file as an attachment to an email sent with
 something like the following ?

  $headers = From: .$fromaddress.\r\n;
  $headers .= Reply-To: $fromaddress\r\n;
mail($toaddress, $subject, $mailcontent, $headers);

 Thanks
 Don


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.529 / Virus Database: 324 - Release Date: 16/10/2003

-- 
Evan Nemerson
[EMAIL PROTECTED]

--
A leader is the wave pushed ahead by the ship.

-Leo Nikolaevich Tolstoy

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Attachments

2002-04-24 Thread The_RadiX

I have read briefly through past topics..


Just wanted to know:

A) How do you use attachments in the: mail() function


B) how using attachments would I compose an email to batch off using text/html as a 
optional item if the client supports it or use the default text/plain ??



Thx a heap


:::
:  Julien Bonastre [The-Spectrum.org CEO]  
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::





Re: [PHP] Attachments

2002-04-24 Thread Richard Emery

GOOGLE found this on first try
http://www.zend.com/zend/spotlight/sendmimeemailpart1.php

- Original Message -
From: The_RadiX [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 24, 2002 7:22 AM
Subject: [PHP] Attachments


I have read briefly through past topics..


Just wanted to know:

A) How do you use attachments in the: mail() function


B) how using attachments would I compose an email to batch off using
text/html as a optional item if the client supports it or use the default
text/plain ??



Thx a heap


:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-24 Thread Liam MacKenzie

http://www.hotscripts.com/PHP/Scripts_and_Programs/Email_Systems/Email_Utili
ties/


- Original Message -
From: The_RadiX [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 24, 2002 10:22 PM
Subject: [PHP] Attachments


I have read briefly through past topics..


Just wanted to know:

A) How do you use attachments in the: mail() function


B) how using attachments would I compose an email to batch off using
text/html as a optional item if the client supports it or use the default
text/plain ??



Thx a heap


:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-22 Thread Jason Wong

On Monday 22 April 2002 02:33, Jason Soza wrote:
 Hmm... Okay, I used this script I found on hotscripts - it copies the
 entire file to the specified directory:

   echo pcenterTrying to upload to: 
  . $upload_path . $filename . /center/p\n;

   if ( file_exists($upload_path.$filename) ) {
  echo pfont color='red'center
 . $message[fileexists]./font/center/p;

   } else {
  if( move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],
$upload_path.$filename) ) {
 echo pcenter . $message[complete]./center/p;
  } else {
 echo pfont color='red'center
. $message[incomplete]./font/center/p;
  }

 Now why would this work but the e-mail scripts not?

1) Did *you* write both the php  perl scripts? Just checking, if you wrote 
both, then you might have made the same mistake in both ;-) If they're by 
independent authors then the chances of the same mistake are slightly lower.

2) Just to really confirm that the upload process is not the problem can you 
try sending a local existing file using your scripts?

3) In your scripts I can't see where the attachments (ie the files) gets 
encoded to base64. Have I missed something?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Who are you?
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-22 Thread Jason Soza

I actually was using other scripts I'd found, written by different 
authors. I did this to try to save time, but this hasn't been the case.

All I was looking to do was have someone fill out a form, hit submit, 
and I would have the contents of the form e-mailed to me, and any 
attachments would be sent as well.

I think that since that last upload script works and the two scripts 
that sent the attachments via e-mail didn't work, I'm just going to try 
my hand at writing my own script using the mail() function. I'll just 
have the script e-mail me the form contents and upload the files to an 
incoming directory with a timestamp prefix, so I can match the e-mails 
with the uploads. This should be a fairly straightforward task, correct?

Jason Soza

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
Date: Monday, April 22, 2002 0:54 am
Subject: Re: [PHP] Attachments

snip
 1) Did *you* write both the php  perl scripts? Just checking, if 
 you wrote 
 both, then you might have made the same mistake in both ;-) If 
 they're by 
 independent authors then the chances of the same mistake are 
 slightly lower.
 
 2) Just to really confirm that the upload process is not the 
 problem can you 
 try sending a local existing file using your scripts?
 
 3) In your scripts I can't see where the attachments (ie the 
 files) gets 
 encoded to base64. Have I missed something?
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications 
 Development *
 
 /*
 Who are you?
 */
/snip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-21 Thread Jason Wong

On Sunday 21 April 2002 06:02, Jason Soza wrote:
 They actually vary as to where they become truncated - some are at 633
 bytes, some are at 1kb. The odd thing is that the PHP script I'm using to
 process the form actually pics up the correct filesize, it reports it to me
 under a $filesize variable I've setup. It'll report, say file2_filesize...:
 69147 but the actual attachment is 1kb.

Please post your code.

 Like I said, I have this same problem using both Perl scripts and PHP
 scripts. In php.ini my post_max size is 8M and upload_max_filesize is 2M.
 Looking through the Apache mailing list archives, it looks like others
 running Apache on win32 have experienced the same problems, but there are
 no answers. I'm a little stumped myself!

Have you narrowed down the problem to whether the uploaded file is truncated 
or whether the mail attachment process truncates the file?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
 EVACUATION ROUTE 
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Attachments

2002-04-21 Thread Jason Soza

I haven't been able to identify what process actually truncates the file.
All I know is that it's not my mailserver. I don't believe it's in the
coding either, as both Perl and PHP do this, and both work great otherwise.
Anyhow:

This reads the file from the form:
function get_file($filename){

$return = '';
if($fp = fopen($filename, 'rb')){
while(!feof($fp)){
$return .= fread($fp, 1024);
}
fclose($fp);
return $return;

}else{
return FALSE;
}
}

This adds any files to a list of attachments:
function add_attachment($file, $name = '',
$c_type='application/octet-stream', $encoding = 'base64'){
$this-attachments[] = array(
'body'  = 
$file,
'name'  = 
$name,
'c_type'   
 = $c_type,
'encoding' 
 = $encoding
  );
}

This adds a MIME subpart for the attachment:
function add_attachment_part($obj, $value){

$params['content_type'] = $value['c_type'];
$params['encoding'] = $value['encoding'];
$params['disposition']  = 'attachment';
$params['dfilename']= $value['name'];
$obj-addSubpart($value['body'], $params);
}

This is out of the build mail function, adding the text and attachments to
an e-mail:
case $text AND $attachments:
$message = $this-add_mixed_part();
$this-add_text_part($message, $this-text);

for($i=0; $icount($this-attachments); $i++)
$this-add_attachment_part($message, 
$this-attachments[$i]);
break;

Anything look wrong so far?

Just in case this may help, here's the part of the Perl script that adds
files to the e-mail. This script results in a truncation the same way as the
PHP script:

sub attachFilesToMail {
my $type = shift;
my $msg = shift;
my $hasBody = shift;
my ($key, $file);
while (($key, $file) = each %{$CONFIG{$type}}) {
($debug)  print STDERR examining attachment $key, $file\n;
next unless ($key =~ /(\d+)file/  -f $file);
my $attachNum = $1;
$file =~ m!/([^/]+)$!;
my $filename = $1;
my $mime_type =
$CONFIG{$type}-{${attachNum}mime};
($debug)  print STDERR Attaching a mime type of $mime_type for
$filename ($key)\n;
unless ($mime_type) {
$mime_type = (!$fhBug  -T $file) ? 'text/plain' :

'application/octet-stream';
}
my @stats  = stat($file);
($debug)  print STDERR Attaching $file ($stats[7] bytes)  .
 to email\n;
my $data = { Path = $file,
 ReadNow = 1,
 Filename = $filename
 };
unless ($mime_type =~ /^text\//) {
$data-{'Encoding'} = base64;
}

if (!$hasBody) {
$$msg-data(This is a MIME message with attachments);
}
my $m = $$msg-attach(%$data);
$m-attr(content-type = $mime_type);
}
}
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 21, 2002 12:10 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Attachments


On Sunday 21 April 2002 06:02, Jason Soza wrote:
 They actually vary as to where they become truncated - some are at 633
 bytes, some are at 1kb. The odd thing is that the PHP script I'm using to
 process the form actually pics up the correct filesize, it reports it to
me
 under a $filesize variable I've setup. It'll report, say
file2_filesize...:
 69147 but the actual attachment is 1kb.

Please post your code.

 Like I said, I have this same problem using both Perl scripts and PHP
 scripts. In php.ini my post_max size is 8M and upload_max_filesize is 2M.
 Looking through the Apache mailing list archives, it looks like others
 running Apache on win32 have experienced the same problems, but there are
 no answers. I'm a little stumped myself!

Have you narrowed down

Re: [PHP] Attachments

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 01:51, Jason Soza wrote:
 I haven't been able to identify what process actually truncates the file.

This should be the easiest to nail down. Add a bit of code so that when the 
file gets uploaded, it gets copied somewhere, then you can manually check its 
size. Obviously, if the filesize is OK then the problem is further down the 
line (probably the mail code).

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
f u cn rd ths, itn tyg h myxbl cd.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Attachments

2002-04-21 Thread Jason Soza

Hmm... Okay, I used this script I found on hotscripts - it copies the entire
file to the specified directory:

  echo pcenterTrying to upload to: 
 . $upload_path . $filename . /center/p\n;

  if ( file_exists($upload_path.$filename) ) {
 echo pfont color='red'center
. $message[fileexists]./font/center/p;

  } else {
 if( move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],
   $upload_path.$filename) ) {
echo pcenter . $message[complete]./center/p;
 } else {
echo pfont color='red'center
   . $message[incomplete]./font/center/p;
 }

Now why would this work but the e-mail scripts not?


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 21, 2002 10:13 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Attachments


On Monday 22 April 2002 01:51, Jason Soza wrote:
 I haven't been able to identify what process actually truncates the file.

This should be the easiest to nail down. Add a bit of code so that when the
file gets uploaded, it gets copied somewhere, then you can manually check
its
size. Obviously, if the filesize is OK then the problem is further down the
line (probably the mail code).

--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
f u cn rd ths, itn tyg h myxbl cd.
*/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Attachments

2002-04-20 Thread Jason Soza

Sorry for the thread thing, I wasn't aware I was causing probs. I usually
just use Reply to save having to enter the e-mail address, just laziness.
I'll keep from doing in this in the future, thanks for letting me know.

I'm using 'POST' in my forms - any other ideas or places I could check?
Thanks again.

Jason

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 19, 2002 8:36 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Attachments


On Saturday 20 April 2002 12:29, Jason Soza wrote:

 Using both Perl and PHP to send mail with attachments from forms, the
 attachments get truncated. Since both Perl scripts and PHP scripts do
this,
 I'm ruling out coding error, and since my mailserver has been receiving
 e-mails from other sources and has transmitted the whole attachments from
 them, I'm ruling it out too. Does anyone know if Apache has some sort of
 limitation on attachments? Is there a setting for this in httpd.conf? I
 don't have any .htaccess files laying around, just httpd.conf and virtual
 hosts. Is there like a max_file_size thing I need to mess with?

If you're using GET in your form(s) change it to POST.

Also, please do not reply to an existing thread and change the subject. This
messes up the threading for those of us who use an intelligent mail client.
Start your own thread.

--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
QOTD:
If it's too loud, you're too old.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-20 Thread Jason Wong

On Saturday 20 April 2002 18:25, Jason Soza wrote:
 Sorry for the thread thing, I wasn't aware I was causing probs. I usually
 just use Reply to save having to enter the e-mail address, just laziness.
 I'll keep from doing in this in the future, thanks for letting me know.

Thanks, you'll annoy fewer people :)

 I'm using 'POST' in my forms - any other ideas or places I could check?
 Thanks again.

There are a couple of settings in php.ini you could look at:

post_max_size
upload_max_filesize


Have you tried varying size attachments to see at what point the attachments 
become truncated?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Refreshed by a brief blackout, I got to my feet and went next door.
-- Martin Amis, _Money_
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Attachments

2002-04-20 Thread Jason Soza

They actually vary as to where they become truncated - some are at 633
bytes, some are at 1kb. The odd thing is that the PHP script I'm using to
process the form actually pics up the correct filesize, it reports it to me
under a $filesize variable I've setup. It'll report, say file2_filesize...:
69147 but the actual attachment is 1kb.

Like I said, I have this same problem using both Perl scripts and PHP
scripts. In php.ini my post_max size is 8M and upload_max_filesize is 2M.
Looking through the Apache mailing list archives, it looks like others
running Apache on win32 have experienced the same problems, but there are no
answers. I'm a little stumped myself!

I've found that even PHP upload scripts I've gotten from hotscripts.com
don't execute correctly either. A bit discouraging, as this problem is
seriously affecting a website I was hoping to have completed this weekend.

Thanks for your help,
Jason

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 20, 2002 3:32 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Attachments

 I'm using 'POST' in my forms - any other ideas or places I could check?
 Thanks again.

There are a couple of settings in php.ini you could look at:

post_max_size
upload_max_filesize


Have you tried varying size attachments to see at what point the attachments
become truncated?

--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Refreshed by a brief blackout, I got to my feet and went next door.
-- Martin Amis, _Money_
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Attachments

2002-04-19 Thread Jason Soza

I apologize in advance, this question most likely doesn't belong here, but
if anyone can help that'd be great:

Using both Perl and PHP to send mail with attachments from forms, the
attachments get truncated. Since both Perl scripts and PHP scripts do this,
I'm ruling out coding error, and since my mailserver has been receiving
e-mails from other sources and has transmitted the whole attachments from
them, I'm ruling it out too. Does anyone know if Apache has some sort of
limitation on attachments? Is there a setting for this in httpd.conf? I
don't have any .htaccess files laying around, just httpd.conf and virtual
hosts. Is there like a max_file_size thing I need to mess with?

Again, I apologize for the off-topic nature of this, just looking for some
help.

Thanks,
Jason


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments

2002-04-19 Thread Jason Wong

On Saturday 20 April 2002 12:29, Jason Soza wrote:

 Using both Perl and PHP to send mail with attachments from forms, the
 attachments get truncated. Since both Perl scripts and PHP scripts do this,
 I'm ruling out coding error, and since my mailserver has been receiving
 e-mails from other sources and has transmitted the whole attachments from
 them, I'm ruling it out too. Does anyone know if Apache has some sort of
 limitation on attachments? Is there a setting for this in httpd.conf? I
 don't have any .htaccess files laying around, just httpd.conf and virtual
 hosts. Is there like a max_file_size thing I need to mess with?

If you're using GET in your form(s) change it to POST.

Also, please do not reply to an existing thread and change the subject. This 
messes up the threading for those of us who use an intelligent mail client. 
Start your own thread.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
QOTD:
If it's too loud, you're too old.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Attachments with mail() function

2002-01-30 Thread Edward van Bilderbeek - Bean IT

I recommend sending yourself a mail with an attachment and check the
sourcecode of the received mail... together with base64encode() you should
be able to do the job...

Edward

- Original Message -
From: Rafael Perazzo B Mota [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 30, 2002 3:11 AM
Subject: [PHP] Attachments with mail() function


 How can I send a simple file as attachment using the mail function ?
 Can anyone give me a simple example  ?

 Thanks

 Rafael Perazzo


 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.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 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] Attachments with mail() function

2002-01-29 Thread Boaz Yahav

Class to send a file as an attachment with the php mail() function.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1583

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: Rafael Perazzo B Mota [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 4:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Attachments with mail() function


How can I send a simple file as attachment using the mail function ?  
Can anyone give me a simple example  ? 

Thanks 

Rafael Perazzo


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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 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] Attachments again

2001-11-12 Thread Oosten, Sjoerd van

Hi,

When i send a dynamic HTML newletter, which contains newsitems in the
database I now send the e-mail with a link to the image on the webserver.
What i would like to do is instead of linking the image, send the image as a
sort of attachment. So an internetconnection is not required when viewing
the e-mail.

Is this possible and how should I do this?

Thanks in advance,

Sjoerd


Sjoerd van Oosten 
Digitaal vormgever [EMAIL PROTECTED]
Datamex E-sites B.V. 
http://www.esites.nl
Minervum 7368 Telefoon: (076) 5 730 730 
4817 ZH BREDA Telefax: (076) 5 877 757 
___


-- 
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] Attachments again

2001-11-12 Thread PHPGalaxy.com

I've found a great SMTP class file that supports file attachments. Its just a
few lines of code that base64_encode's the attachment, and sticks it at the end
of the email. I guess just rip whatever code ya need out of this, for doing
attachments, and insert it into your own. Maybe do a little RFC reading to
figure out multiple atachments. =)

(sendmsg() Copyright © 2001 Wanja Hemmerich)
?
function sendmsg($to, $subject, $text, $from, $file, $type) {
 $content = fread(fopen($file,r),filesize($file));
 $content = chunk_split(base64_encode($content));
 $uid = strtoupper(md5(uniqid(time(;
 $name = basename($file);

 $header = From: $from\nReply-To: $from\n;
 $header .= MIME-Version: 1.0\n;
 $header .= Content-Type: multipart/mixed; boundary=$uid\n;

 $header .= --$uid\n;
 $header .= Content-Type: text/plain\n;
 $header .= Content-Transfer-Encoding: 8bit\n\n;
 $header .= $text\n;

 $header .= --$uid\n;
 $header .= Content-Type: $type; name=\$name\\n;

 $header .= Content-Transfer-Encoding: base64\n;
 $header .= Content-Disposition: attachment; filename=\$name\\n\n;
 $header .= $content\n;

 $header .= --$uid--;

 mail($to, $subject, , $header);

 return true;
}
?

--
From PHPGalaxy.com, earn up to $10 per order selling our PHP Scripts
and Software on your Site. http://www.phpgalaxy.com/aff/

Also, get a fast free POP3 email account, you @php.la at
http://www.phpgalaxy.com/search/



-- 
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] Attachments again

2001-11-12 Thread Caspar Kennerdale

On the attachment subject,

does anyone know how to specify multiple mime types?

I have my attachment script, however people may be using it to send gifs,
swfs, or text files

I am specifyinmg the mime types like this


$type =  image/gif;

 $header .= Content-Type: $type;

wuld I do something like turn $type into an array or do something like

$type =  image/gif | mimetype/2 | mimetype/3 | mimetype/4;

THis doesnt seem to work  (obviously mimetype/ * = a specified mime type)

Thanks in advance for any suggestions

Caspar


-- 
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] Attachments again

2001-11-12 Thread DL Neil

Hi Sjoerd,
 
 When i send a dynamic HTML newletter, which contains newsitems in the
 database I now send the e-mail with a link to the image on the webserver.
 What i would like to do is instead of linking the image, send the image as a
 sort of attachment. So an internetconnection is not required when viewing
 the e-mail.


I use www.phpguru.org's, HTML MIME class.

Regards,
=dn



-- 
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] attachments

2001-08-21 Thread Nicholas Thompson


 I am currently using an e-mail page that supports uploads, but does anyone know how 
to get the attachment to actually attach to the message? (perhaps even upload it to 
other mail servers like yaho)  Uploading to my server is fine, but when I send 
messages with attachments and check my mail through yahoo, the little attachments icon 
is not there. 



-
Do You Yahoo!?
Make international calls for as low as $0.04/minute with Yahoo! Messenger.


[PHP] Attachments in POP

2001-06-20 Thread Ker Ruben Ramos

Why are attachments in POP cannot be viewed in latest IMP? but if I use
IMAP, it works just fine.




Re: [PHP] Attachments in POP

2001-06-20 Thread Ker Ruben Ramos

oops :) sorry... used the wrong lists

- Original Message - 
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Ker Ruben Ramos [EMAIL PROTECTED]
Sent: Wednesday, June 20, 2001 10:59 PM
Subject: Re: [PHP] Attachments in POP


  Why are attachments in POP cannot be viewed in latest IMP? but if I use
  IMAP, it works just fine.
 
 That would be a question for the IMP mailing list, not php-general.
 
 -Rasmus
 
 


-- 
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] attachments in mail

2001-04-12 Thread Dan Cleveland

How can i include a file as an attachment in an email?  I'm looking for
something like this...

mail($to_email,%subject,$content,$attached_file);

Thanks in advance!

Dan

+---+
|   |
|  If Yoda so strong in force is,   |
| why words in proper order he cannot put?  |
|   |
+---+
|   |
+---+
| Daniel J. Cleveland   |
|   e-mail: [EMAIL PROTECTED]|
+---+


-- 
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] attachments with mail() function

2001-03-25 Thread BlackLord

Thank you Michael. I will look for mime_mail classes.


"Michael Hall" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 I'm not sure about including them in the mail function as such, but it can
 certainly be done using one of several mime_mail classes that are around.
 I don't have one handy right now but you can find them by searching the
 php archives
 and/or the annotated php manual. I know the one by Schumann and
 Ratschiller works OK.


 Mick

 On Sun, 25 Mar 2001, BlackLord wrote:

  Is there anyway to include attachments in mail() function?
 
  If you give a small example, it will be great.
 
  Thanks
 
 
 
  --
  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 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 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] attachments with mail() function

2001-03-24 Thread BlackLord

Is there anyway to include attachments in mail() function?

If you give a small example, it will be great.

Thanks



-- 
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]