Jump to content


Photo

Send mail with attachment


  • Please log in to reply
3 replies to this topic

#1 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 07 April 2006 - 02:20 PM

Hi guys,

I've performed a search but, unhappy, don't find topics with this problem.

I need to send a mail.. like newsletter, but with attachment!

I read somewhere about use mimetype to send images, but long time ago.. to send files, any kind of files.. what I suppose to do?

Thank you.

D.Soul
(If something is wrong, please tell me. I'm learning this language. Thank you)

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 07 April 2006 - 03:55 PM

I'm not sure of how it can be done with the standard mail() function, but there is a class about called 'phpmailer' that can send mail with attachments.

#3 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 07 April 2006 - 06:12 PM

I've built a code, and its apper work fine.. dont clue here because it have 215 lines (with coments), so i can write a tutorial if someone need..

but i still have a problem..

I need to know what kind of file the mail is attaching.. my code to do this:

    if ( strtoupper ( $arq_extensao ) == 'PDF' )
    {
        $arq_aplicacao = 'pdf';
    }
    elseif ( strtoupper ( $arq_extensao ) == 'DOC' )
    {
        $arq_aplicacao = 'msword';
    }
But, i need a function to take the file extension ($arq_extensao).. this if will filter the mime "application/[type]".

Have some function to retrieve these extension?

Thanks, D.Soul
(If something is wrong, please tell me. I'm learning this language. Thank you)

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 07 April 2006 - 07:10 PM

Take a look at the function [a href=\"http://www.php.net/mime_content_type\" target=\"_blank\"]mime_content_type[/a]().

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users