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

Email Attachement Issue #907

Closed
SandeepChauhan217 opened this issue Nov 14, 2019 · 1 comment
Closed

Email Attachement Issue #907

SandeepChauhan217 opened this issue Nov 14, 2019 · 1 comment
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library

Comments

@SandeepChauhan217
Copy link

SandeepChauhan217 commented Nov 14, 2019

Hello Support,
I have an issue with email attachment when i have attache a file in the email the mail will not gone and error will come

[14-Nov-2019 07:15:27 UTC] PHP Fatal error:  Uncaught Guzzle\Common\Exception\InvalidArgumentException: Unable to open https://www.artisticbird.com/artisticbird-neo//resume/1438240976.pdf for reading in /home/abird/public_html/sendgrid-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/PostFile.php:53
Stack trace:
#0 /home/abird/public_html/sendgrid-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/PostFile.php(28): Guzzle\Http\Message\PostFile->setFilename('https://www.art...')
#1 /home/abird/public_html/sendgrid-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/EntityEnclosingRequest.php(199): Guzzle\Http\Message\PostFile->__construct('files[143824097...', '@https://www.ar...', NULL, NULL)
#2 /home/abird/public_html/sendgrid-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/RequestFactory.php(106): Guzzle\Http\Message\EntityEnclosingRequest->addPostFile('files[143824097...', '@https://www.ar...')
#3 /home/abird/public_html/sendgrid-php/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php(201): Guzzle\Http\Message\RequestFactory->create('POST', 'https://api.sen. in /home/abird/public_html/sendgrid-php/vendor/guzzle/guzzle/src/Guzzle/Http/Message/PostFile.php on line 53

Please help me to solve this error.

@kampalex
Copy link
Contributor

kampalex commented Dec 4, 2019

Hi! This issue isn't related to SendGrid but to (dependency) GuzzleHttp.

The URL you provide contains a double slash (//) which may cause an issue.

I suggest to attach the file locally (using absolute/relative path to the file) and verify it's existing using file_exists. Then it shouldn't be a problem to attach and send it using SendGrid.
If you don't have it locally, download it first by using (f.e.) file_get_contents.

@childish-sambino childish-sambino added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

3 participants