[FLOW3-general] Swift Mailer Attachment

Markus Goldbeck mgoldbeck at cross-content.com
Tue Sep 27 10:56:36 CEST 2011


Hi Christian,

always this problems with this namespaces. I thought that I have to use 
it because the library of SwiftMailer is in Ressources of the Package. 
But anyway thank you very much.

You saved my day ;)

cheers,

Markus

Am 27.09.2011 10:43, schrieb "Christian Müller (Kitsunet)":
> Hi Markus,
>
> only a few classes of SwiftMailer are extended for the package (one
> example being \TYPO3\SwiftMailer\Message) but not all of them.
>
> The Swift_Attachment is not extended so it has no namespaces as
> SwiftMailer doesn't use it. So \Swift_Attachment::fromPath should do the
> trick.
>
> cheers,
> Christian
>
> On 27/09/11 10:30, Markus Goldbeck wrote:
>> Hello everybody,
>>
>> I have some Problem to attach an attachment to my SwiftMailer Objekt.
>> Swift_attachment is not found but I can't understand why.
>>
>> $mail = new \TYPO3\SwiftMailer\Message();
>>
>>
>> $mail ->setFrom(array('bla at bla.de' => 'some Guy from'))
>> ->setTo(array('to at to.de' => 'foo'))
>> ->setSubject('Mail Subject')
>> ->setBody("some content")
>> ->attach(\TYPO3\SwiftMailer\Swift_Attachment::fromPath($filepath))
>> ->send();
>>
>> Another path I tried was \TYPO3\Swift_Attachment::
>>
>>
>> error Message:
>> PHP Fatal error: Class 'TYPO3\\SwiftMailer\\Swift_Attachment' not found
>> in
>> /var/www/FLOW3/Data/Temporary/Development/Cache/Code/FLOW3_Object_Classe
>>
>>
>> Any hint is very welcome.
>>
>> Best Regards,
>>
>> Markus
>



More information about the FLOW3-general mailing list