Bug #25220
closed
t3lib_div::t3lib_htmlmail->sendtheMail() is unable to send mail with attachments
Added by RENIER over 13 years ago.
Updated almost 9 years ago.
Description
When trying to send a mail with an attachement (one ZIP file, about 1.5Mb), the sendtheMail() function does report a fatal error :
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16 bytes) in /var/www/.typo3_src/typo3_src-4.5.2/typo3/contrib/swiftmailer/classes/Swift/CharacterReader/Utf8Reader.php on line 99
with Typo3 4.4.7, it works fine.
ps : the error line number on Utf8Reader.php can takes different values : 99, 113
for information, my code is :
$oHtmlMail = t3lib_div::makeInstance('t3lib_htmlmail');
$oHtmlMail->start();
$oHtmlMail->subject = $subject;
$oHtmlMail->from_email = $this->conf['emailFrom'];
$oHtmlMail->replyto_email = $this->conf['emailFrom'];
$oHtmlMail->setRecipient($dest);
$oHtmlMail->setHTML($textEmail);
$oHtmlMail->addAttachment("/tmp/$filename");
$oHtmlMail->setHeaders();
$oHtmlMail->setContent();
$okCustEmail = $oHtmlMail->sendtheMail();
(issue imported from #M17821)
- Target version deleted (
0)
Out of memory error could appear in another file /typo3_src-4.5.2/typo3/contrib/swiftmailer/classes/Swift/CharacterStream/NgCharacterStream.php on line 256.
Generally the only solution I found is disabling SwiftMailer and switch to old one.
Using SwiftMailer is making impossible to send any emails with attachments, no matter how much memory I allow for php and how small attached file is.
Out of memory with 2kb attachment and memory limit of 128Mb is nonsense.
- Category set to Miscellaneous
- Target version set to 4.5.23
- Complexity set to medium
I've noticed the same here with a server which has 512mb allocated and sending an attachment of 1kb with powermail. SwiftMailer uses an incredible amount of memory when it comes to sending attachments.
- Status changed from New to On Hold
Just set this to on hold as it's an external issue. Thanks for the link Jose! :-)
I am not sure that swiftmailer issue 88 is directly about this topic.
It is about sending huge mails, more than 1 mb of html text, while this typo3 issue is about sending normal size (less than 100 kb) mails with tiny attachment, like 2kb.
- Status changed from On Hold to Needs Feedback
- Assignee set to Mathias Schreiber
- Is Regression set to No
Yes. Issue still exists in 4.5.40
what about the latest versions? 6.2.12 or 7(master) ? Is this still present?
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Mathias Schreiber)
- Target version deleted (
4.5.23)
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Also available in: Atom
PDF