sendgrid message: 'The from email does not contain a valid address.' code example

Example: sendgrid message: 'The from email does not contain a valid address.'

setContent(base64_encode($data));
$attachment->setType($type);
$attachment->setFilename("releaseapk.apk");
$attachment->setDisposition("attachment");
$attachment->setContentId("releaseapk");
$mail->addAttachment($attachment);

$response = $sg->client->mail()->send()->post($mail);
echo $response->statusCode();
echo $response->headers();
echo $response->body();

Tags:

Misc Example