RE: Re: Q about attachment.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Although PHP is capable of sending emails without any additional software, if
you're intending to send HTML mesages, or mail attachments, then you probably
need to use the PEAR Mail_Mime class :-
 
http://pear.php.net/package/Mail_Mime
 
<?php
include('Mail.php');
include('Mail/mime.php');

$text = 'Text version of email';
$html = '<html><body>HTML version of email</body></html>';
$file = '/home/richard/example.php';
$crlf = "\n";
$hdrs = array(
              'From'    => 'you@xxxxxxxxxxxxxx',
              'Subject' => 'Test mime message'
              );

$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file, 'text/plain');

//do not ever try to call these lines in reverse order
$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$mail =& Mail::factory('mail');
$mail->send('postmaster@localhost', $hdrs, $body);
?>

 
Rob.

________________________________

From: php-objects@xxxxxxxxxxxxxxx on behalf of SaEeDoS
Sent: Tue 10/2/2007 9:53 PM
To: php-objects@xxxxxxxxxxxxxxx
Subject:  Re: Q about attachment.



Thanks Mr.Abhishek for your answer .
i'm sorry for not being clear in my e-mail , i will try to be clear
this time . what i want is like an e-mail, when you want send e-mail
to anyone with attachment first u make a compose then you put his
e-mail address (his id), and u attach the file then you send it,,, i
want to make like this process ... i want to send a specific file as
an attachment to a specific user by put his ID..
i hope you can understand me :-) 

Thank you very much

--- In php-objects@xxxxxxxxxxxxxxx, abhishek jain <ejaincom@...> wrote:
>
> hi,
> no i really cannot understand what you really want,
> do you want to have info abt BCC: , if so pl. specify, for it you
need to insert the appropriate headers,
> thanks,
> 
> --
> Regards,
> Abhishek jain
>
>
>
> ----- Original Message ----
> From: SaEeDoS <saeedos@...>
> To: php-objects@xxxxxxxxxxxxxxx
> Sent: Tuesday, October 2, 2007 10:42:31 AM
> Subject:  Q about attachment.
>
> hi all , i'm working on WMS project ( Workflow management System),i'm
> using PHP and MySQL.
> i have a Question about :
> i want to attach a file , let say a picture and send it from user A to
> user B , and the other user's can NOT see what he send (user A), it's
> looks like an e-mail when u receive an attachment.
> how can i make that ... "just tell me the idea"
> i hope u can understand what i want .
> and Thank you all
>
>
>
>
>
>     
_____________________________________________________________________________
_______
> Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s
user panel and lay it on us.
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>
>
> [Non-text portions of this message have been removed]
>




PHP Data object relational mapping generator
http://www.metastorage.net/
Yahoo! Groups Links






***********************************************************************************
Any opinions expressed in email are those of the individual and not necessarily those of the company. This email and any files transmitted with it are confidential and solely for the use of the intended recipient 
or entity to whom they are addressed. It may contain material protected by attorney-client privilege. If you are not the intended recipient, or a person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited.

Random House Group + 44 (0) 20 7840 8400
http://www.randomhouse.co.uk
http://www.booksattransworld.co.uk 
http://www.kidsatrandomhouse.co.uk
Generic email address - enquiries@xxxxxxxxxxxxxxxxx

Name & Registered Office:
THE RANDOM HOUSE GROUP LIMITED
20 VAUXHALL BRIDGE ROAD
LONDON
SW1V 2SA
Random House Group Ltd is registered in the United Kingdom with company No. 00954009, VAT number 102838980
***********************************************************************************



[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux