how to attach a file???

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
deadman
Forum Newbie
Posts: 3
Joined: Mon May 03, 2010 2:14 am

how to attach a file???

Post by deadman »

I'm trying to attach a file with my swift mailer code.......what should I do????

Thanx in advance
deadman
rahulzatakia
Forum Commoner
Posts: 59
Joined: Fri Feb 05, 2010 12:01 am
Location: Ahmedabad

Re: how to attach a file???

Post by rahulzatakia »

Hi, just check out the below link..

http://swiftmailer.org/wikidocs/v3/tuto ... ttachments
deadman
Forum Newbie
Posts: 3
Joined: Mon May 03, 2010 2:14 am

Re: how to attach a file???

Post 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
rahulzatakia
Forum Commoner
Posts: 59
Joined: Fri Feb 05, 2010 12:01 am
Location: Ahmedabad

Re: how to attach a file???

Post by rahulzatakia »

hi.. if you are using swift mailer, then the below link will be helpful, try out...

http://swiftmailer.org/docs/attaching-files
deadman
Forum Newbie
Posts: 3
Joined: Mon May 03, 2010 2:14 am

Re: how to attach a file???

Post 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
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: how to attach a file???

Post 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
Post Reply