Jump to content

Archived

This topic is now archived and is closed to further replies.

Darkness Soul

Send mail with attachment

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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:

[code]    if ( strtoupper ( $arq_extensao ) == 'PDF' )
    {
        $arq_aplicacao = 'pdf';
    }
    elseif ( strtoupper ( $arq_extensao ) == 'DOC' )
    {
        $arq_aplicacao = 'msword';
    }[/code]
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

Share this post


Link to post
Share on other sites
Take a look at the function [a href=\"http://www.php.net/mime_content_type\" target=\"_blank\"]mime_content_type[/a]().

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.