Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to attach 5 dynamic text file in mail but not working.

I send single attachment in email working perfect my code is :

  $Email->attachments('path/to/example.txt');

But i send multiple attachment in email not working.

My code is :

$Email->attachments('path/to/example.txt','path/to/example1.txt','path/to/example3.txt','abs/path/to/example4.txt','path/to/example5.txt');
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
203 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try this code for multiple attachment :

$Email->attachments(array(
            'example.txt' => array(
                'file' => 'path/to/example.txt',
                'mimetype' => 'text/plain'
            ),
example1.txt' => array(
                'file' => 'path/to/example1.txt',
                'mimetype' => 'text/plain'
            ),
example3.txt' => array(
                'file' => 'path/to/example3.txt',
                'mimetype' => 'text/plain'
            ),
example4.txt' => array(
                'file' => 'path/to/example4.txt',
                'mimetype' => 'text/plain'
            ),
example5.txt' => array(
                'file' => 'path/to/example5.txt',
                'mimetype' => 'text/plain'
            )

        ));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...