Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachment is not being attached #5

Open
sarahman opened this issue Aug 5, 2018 · 3 comments
Open

Attachment is not being attached #5

sarahman opened this issue Aug 5, 2018 · 3 comments

Comments

@sarahman
Copy link

sarahman commented Aug 5, 2018

While a pdf file is being tries to be attached through the attachData method, it does not add to the Mail. My code is:

\Mail::send(['html' => 'This is just a sample email with an attachment.', 'raw' => true], [], function ($message) use ($invoicePdf) {
    /** @var \Illuminate\Mail\Message $message */
    $message->to('aabid048@gmail.com'));
    $message->subject('Sample Email of Invoice');
    $message->attachData(base64_encode($invoicePdf), 'Invoice.pdf');
});

Please help you send email through your library.
Thanks in advance!

@Lidbetter
Copy link
Member

Lidbetter commented Aug 12, 2018

I think this commit should fix the issue: 2628545

Please can you confirm it does fix the issue (packagist dev-master)

let me know and I will tag a release.

@sarahman
Copy link
Author

Thank you for your reply. I'll check that out and inform you!!!

@sarahman
Copy link
Author

My output becomes the following right before sending the email:

array:2 [
  "headers" => array:1 [
    "Authorization" => "Bearer [API_KEY]"
  ]
  "form_params" => array:7 [
    "from" => "aabid048@gmail.com"
    "fromname" => "Syed Abidur Rahman"
    "subject" => "Sample Email of Invoice"
    "html" => """
      Sample Invoice\r\n
      """
    "to" => array:1 [
      0 => "aabid048@gmail.com"
    ]
    "toname" => array:1 [
      0 => "Syed Abidur Rahman"
    ]
    "files" => array:1 [
      "Invoice.pdf" => stream resource @480
        timed_out: false
        blocked: true
        eof: false
        wrapper_type: "plainfile"
        stream_type: "STDIO"
        mode: "r+b"
        unread_bytes: 0
        seekable: true
        uri: "/tmp/phpNFORSp"
        options: []
      }
    ]
  ]
]

Is it Ok? It still sends email without attachment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants