Closed (fixed)
Project:
SMTP Authentication Support
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Feb 2012 at 14:08 UTC
Updated:
24 Jan 2023 at 23:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mavimo commentedImproved patch to support sending mail using filepath and filecontent.
Into mimemail we can send mail using:
in accord with mimemail docs.
Comment #2
felixvang commentedI'm sorry, I'm new to these stuff. What should I do with this .patch file or where should I add it?
Comment #3
gabrielu commentedThanks for the patch @mavimo , patch #1 worked like a charm for me.
I think this should be ported to the next release.
Gabriel
Comment #4
wundo commentedCommited, thanks! :)
Comment #5
killua99 commentedWhen I send a attachment application/pdf mime file it's apear.
The data could not be saved because the destination /tmp/smtpc856Ac is invalid. This may be caused by improper use of file_save_data() or a missing stream wrapper.
File smtp.mail.inc line 432
version = "7.x-1.0-beta2+3-dev"
Comment #6
killua99 commentedOk I can't do a patch cause I'm not using git (sorry) but you can follow this instruction.
Replace all the attachment_new_filename for this.
This is a good use when you creat a tmp name with tmp directory.
Comment #7
tobiasbI get this error with mimemail (rule) and smtp
Comment #8
killua99 commentedAn issue failing with temporary files.
Comment #9
killua99 commentedChange status.
Comment #10
dandaman commentedThe patch in #8 definitely fixed my problem with temporary files from the MIME not saving correctly. Thanks for the patch, killua99!!
Comment #11
wundo commentedLast patch was committed.
Comment #12
tobiasbOk my bug is not solved with the latest release.
When you send a html-email via rules to use the attachments, mimemail creates only an array with the filepath key, no filename or something.
rules_action_mimemail -> drupal_mail -> mimemail_mail
(attachment is a string) -> ... -> attachment is an array.
Comment #13
cgdrupalkwk commentedHaving the same issue as #7. Patch in #12 did not work to solve.
Comment #14
tobiasb@cgdrupalkwk then your rule is wrong ;-)
Comment #15
killua99 commentedDid you test send an attachment without using rules? Because this one seen another kind of issue but with the link of attachment. You use Rules + mimemail + smtp. This issue only use mimemail and smtp. Better to open a new one?
Comment #16
tobiasbOk lets say the patch is a followup. ;-)
Comment #17
chrbak commentedI am having a similar problem with the attachment files. I don't use rules only the mimemail with the simplenews module and the error that i am getting is the bellow:
The solution i found is to delete the lines 447 to 456 and the problem solved. Now i can send newsletters with the attached files.
Comment #18
chrbak commentedI found that at line 449 tries to check a variable that is actualy an oblect like the bellow:
Comment #19
moonberry commentedI have same problem as #17 with sending attachements, here is a patch for dev version 2013-Mar-17.
Comment #20
MarcusOaten commentedFor some reason I seem to get 2 (duplicate) attachments when using rules to send attachments, with both the patch and current Dev version.
Comment #21
killua99 commentedWhy you need to check is not a object? I mean with an isset or !empty you have done that kind of confirmation.
Comment #22
kolafson commentedHad the same issue as #7 and patch in #12 solved it.
Comment #23
jurgenhaasPatch #12 works fine for me.
Comment #24
wundo commentedPatch from #12 was committed, thanks ;)
Comment #26
tetter36 commentedI couldn't send out emails using SMTP, Simplenews, Mimemail, and Elysia Cron. I was receiving the following error in my logs:
Unexpected termination of cron channel default, aborted. Last job executed: simplenews_cron
I then looked in the apache error log and saw this:
PHP Fatal error: Cannot use object of type stdClass as array in /var/www/financesociety/sites/all/modules/smtp/smtp.mail.inc on line 469,Attached is the patch I used to fix the issue. After adding the patch, I didn't get any more errors in the apache log and the emails began sending without the "Unexpected termination of cron channel default, aborted. Last job executed: simplenews_cron" error.
Comment #27
hanskuiters commentedThanks @tetter36, patch #26 works fine for me.
Comment #28
Allerby commentedI had a similar problem using Webform2pdf, SMTP and Mimemail. #26 worked for me - however I had to remove the filecontent object reference in the if statement from line 469 and 472. Not a great solution but it did the trick. My final solution looked like this:
Comment #29
AgentSeo commentedHave similar problem #26, after using patch I didn't get any more errors, but email not sending. If I remove attachments and send email next time, both emails will be sent.
Comment #30
damienmckennaDon't forget to set the status to "needs review" when you upload a patch. Also, the patch doesn't apply.
Comment #31
damienmckennaThe patch needs to be updated to match the Drupal coding standards.
Comment #32
james.williamsPatch #26 will only work for file objects. Mimemail supports attachments being added as arrays (when sent through its own hook_mail implementation), but also allows file objects to be sent directly (e.g. when other module's seek to use its mail system).
So if the SMTP module wants to be able to handle them as Mimemail does, it needs to handle both, not just arrays (as currently since #12 was committed), or just objects (as in patch #26).
The attached patch allows either method to be used, by recognising the same properties of either type that Mimemail uses.
Comment #33
BD3 commentedThe patch in #32 is attaching the file in the email for me, but using Webform2PDF it doesn't attach the PDF from Webform2PDF in the email and below is from the error log when it tries to do so.
Webform 7.x-4.12
Webform2PDF 7.x-4.0
Mime Mail 7.x-1.0-beta4
Mail System 7.x-2.34
SMTP Authentication Support 7.x-1.3
Comment #34
damienmckennaSounds like it needs a little more work.
Comment #35
SkyBuzz commentedI've made the few modifications to the #32 and it is working fine for me.
The webform2pdf provides only
filecontent#32 provides attachment keys for thefilepath. This modification covers both the cases.Comment #36
BD3 commentedI can confirm that #35 works for me with Webform2PDF PDFs being attached and file uploads from the Webform are also being attached.
Comment #38
trumanru commented#35 resolved my problem with attachments in Webform
Comment #40
damienmckennaRerolled, and I fixed the errant whitespace and minor coding standards issues.
Comment #41
jroberts commentedThe patch in #40 resolved the issue for us when using Webform2PDF with SMTP Authentication, MailSystem, MimeMail and attached files in Webform email notifications. Attachments are included properly in all cases.
Comment #42
sam-elayyoub commentedJust to make life easier try to build a simple module calling your file and attach it to any email you want to send
hope this module would solve any problem with the attachments and SWIFTMail or MIMEMail
regards
Sam
Comment #43
johan den hollander commented#40 works for me. I applied this patch to the lastest dev.
7.x-2.x-dev - 2016-Dec-26
Using this with Simplenews including pdf attachment.
Comment #44
sam152 commentedAny reason this wasn't backported/committed to the 1.x branch?
Comment #45
ann b commented#40 worked for me.
Modules Used:
Webform 7.x-4.7
WebForm 2 PDF 7.x-4.0
SMTP Authentication Support 7.x-1.7+3-dev + patch
The site I maintain doesn't use any other mail modules. We do not use mimemail (Am I missing out on something important by not using this module? Why are so many people using this?). Anyway we send out a small number of simple html emails and so far this is all I need.
I tweaked the WebForm 2 PDF code locally and will submit a patch if this patch gets committed here.
All I did was add the module_exists('smtp') condition to also create the attachment the mimemail way if the smtp module exists. This tweak along with patch #40 worked.
Comment #46
rreiss commentedThe patch in #40 works for me on SMTP 7.x-1.7 .
Thanks!
Comment #47
mmaldonado commentedThe patch in # 40 works for me on SMTP 7.x-1.7.
but he gave the error
Notice: Undefined property: stdC lass :: $filecontent in SmtpMailSystem-> mailWithoutQueue () (line 495 of /var/www/html/mysite/sites/all/modules/contrib/smtp/smtp.mail.inc).
This would be the solution to this error:
where is it:
change for:
Comment #48
mmaldonado commentedComment #49
mmaldonado commentedComment #50
robcarrThe patch at #40 works well for me. The patches and #47 and #49 almost worked, but created a 'ghost' copy of the first attachment (ie, has the title, but nil (0KB) content
Comment #51
wundo commentedComment #52
chris matthews commentedComment #53
uberhacker commentedHow about the attached patch?
Comment #54
johan den hollander commentedThe #53 patch applies succesfully to the 7.x-1.x-dev version.
Without the patch attachments are not send. No errors.
With the path attachments are send. No errors no problems ;-)
Comment #55
rasmusknabe@gmail.com commentedCan anyone point to the correct solution for sending email attachments with mimemail through SMTP Authentication..
I have tried almost every patch I can find and different versions of SMTP Auth and Mimemail...
I keep getting an error about the message body being empty!?
Comment #56
bdeleasa commentedThank you so much!! I have a client running D7, Simplenews and SMTP and when sending a test email that had file attachments, the page would redirect immediately to a fatal error, and it was also logging me out after every time I tried to send a test email. Nodes without file attachments weren't causing any issues sending tests; those sent perfectly.
Patch #53 worked perfectly in my case, no more issues sending test emails with file attachments. Thank you!!
Comment #57
damienmckennaComment #58
joseph.olstadComment #60
joseph.olstad