You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pretty simple error, trying to fix it myself but I'm sure you could do it much quicker.
If the email is ONLY plain text with no html, we get an error. If the email has html in it, then all works fine.
<?php
namespace App\Http\Controllers;
use LaravelGmail;
use Illuminate\Http\Request;
class TestGmailApiController extends Controller
{
/**
* testing
*
* @return void
*/
public function test ()
{
//$messages = LaravelGmail::message()->from('someone-who-sends-html-emails@email.com')->take(5)->all();
$messages = LaravelGmail::message()->from('someone-who-sends-plain-text-emails@email.com')->take(5)->all();
foreach ($messages as $message)
{
dump($message->load()->getHtmlBody());
dump($message->load()->getRawPlainTextBody());
dump($message->load()->getPlainTextBody());
}
}
The error message is
Whoops, looks like something went wrong.
1/1
ErrorException in UserRefreshCredentials.php line 91:
Your application has authenticated using end user credentials from Gooogle Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a "quota exceeded" or "API not enabled" error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.
Great, now gmail keeps asking for a service account... might as well be asking me to create a rocket and successfully launch it into space. Thanks Google.
Anyway,
I can't give you the error message, but I spent time on it so I know the problem.
the problem is $body is null on line 376 in Services/Message/Mail.php
public function getBody( $type = 'text/plain' )
{
$part = $this->getBodyPart( $type );
$body = $part->getBody();
return $body->getData();
}
basically in this case something goes null that maybe you're not handling when getBodyPart() or Get Part() is called
when the email is plaintext only..
have you ever tried this on a plaintext email?
The text was updated successfully, but these errors were encountered:
Pretty simple error, trying to fix it myself but I'm sure you could do it much quicker.
If the email is ONLY plain text with no html, we get an error. If the email has html in it, then all works fine.
The error message is
Great, now gmail keeps asking for a service account... might as well be asking me to create a rocket and successfully launch it into space. Thanks Google.
Anyway,
I can't give you the error message, but I spent time on it so I know the problem.
the problem is $body is null on line 376 in Services/Message/Mail.php
basically in this case something goes null that maybe you're not handling when getBodyPart() or Get Part() is called
when the email is plaintext only..
have you ever tried this on a plaintext email?
The text was updated successfully, but these errors were encountered: