Page 1 of 1

how to attach a file???

Posted: Mon May 03, 2010 2:24 am
by deadman
I'm trying to attach a file with my swift mailer code.......what should I do????

Thanx in advance
deadman

Re: how to attach a file???

Posted: Mon May 03, 2010 4:57 am
by rahulzatakia
Hi, just check out the below link..

http://swiftmailer.org/wikidocs/v3/tuto ... ttachments

Re: how to attach a file???

Posted: Mon May 03, 2010 5:23 am
by deadman
hi rahulzatakia,

I used the link u sent, but after using the code I'm facing this error about the class 'Swift_Message_Attachment' .....

here's the error:
Fatal error: Class 'Swift_Message_Attachment' not found in /opt/lampp/htdocs/pit/apps/frontend/modules/home/actions/actions.class.php on line 489

what am i supposed to do now?

thanx
deadman

Re: how to attach a file???

Posted: Mon May 03, 2010 6:04 am
by rahulzatakia
hi.. if you are using swift mailer, then the below link will be helpful, try out...

http://swiftmailer.org/docs/attaching-files

Re: how to attach a file???

Posted: Mon May 03, 2010 7:00 am
by deadman
hi rahulzatakia,

thnx a ton for ur help........... i gt it right this time........but pls do 1 more favour fr me.........tell me if I can specify the path of a file which is on windows, i mean in this code

message->attach(Swift_Attachment::fromPath('/path/to/image.jpg'));

can I specify the path like 'D:\Mine\my report'...... if not then pls suggest me how to do this.....I believe I have to specify the path of a file in LINUX only............then how can I attach a file which is on my windows directory.....



thnx again..
deadman

Re: how to attach a file???

Posted: Mon May 03, 2010 12:57 pm
by Benjamin
Forum Rules wrote: 11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
You may also want to read:
  1. General Posting Guidelines
  2. Posting Code in the Forums
  3. PHP Manual
  4. PHP Tutorials