{"action":"created","issue":{"url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/591","repository_url":"https://api.github.com/repos/sendgrid/sendgrid-php","labels_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/591/labels{/name}","comments_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/591/comments","events_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/591/events","html_url":"https://github.com/sendgrid/sendgrid-php/issues/591","id":308206959,"number":591,"title":"SendGrid\\Content->__construct Error","user":{"login":"gusbemacbe","id":2257024,"avatar_url":"https://avatars2.githubusercontent.com/u/2257024?v=4","gravatar_id":"","url":"https://api.github.com/users/gusbemacbe","html_url":"https://github.com/gusbemacbe","followers_url":"https://api.github.com/users/gusbemacbe/followers","following_url":"https://api.github.com/users/gusbemacbe/following{/other_user}","gists_url":"https://api.github.com/users/gusbemacbe/gists{/gist_id}","starred_url":"https://api.github.com/users/gusbemacbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gusbemacbe/subscriptions","organizations_url":"https://api.github.com/users/gusbemacbe/orgs","repos_url":"https://api.github.com/users/gusbemacbe/repos","events_url":"https://api.github.com/users/gusbemacbe/events{/privacy}","received_events_url":"https://api.github.com/users/gusbemacbe/received_events","type":"User","site_admin":false},"labels":[{"id":733723763,"url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/difficulty:%20unknown%20or%20n/a","name":"difficulty: unknown or n/a","color":"ffffff","default":false},{"id":378656146,"url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/status:%20help%20wanted","name":"status: help wanted","color":"cccccc","default":false},{"id":23680158,"url":"https://api.github.com/repos/sendgrid/sendgrid-php/labels/type:%20question","name":"type: question","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T23:35:05Z","updated_at":"2018-03-24T00:08:54Z","closed_at":null,"author_association":"NONE","body":"#### Issue Summary\r\n\r\nI have copied the simple sample of an example and I have replaced `text/plain` for `text/html`. But it gave an error of `SendGrid\\Content->__construct`. Remember I am not using Composer. I have already echoed and exported the SendGrid API key to .env. \r\n\r\n#### Steps to Reproduce\r\n\r\n1. I have copied the example from this README.md and replaced something:\r\n\r\n```php\r\n<?php\r\n\r\nrequire(\"sendgrid-php/sendgrid-php.php\");\r\n\r\nheader(\"Access-Control-Allow-Origin: *\");\r\n\r\n$from = new SendGrid\\Email(\"Atlética UNISAL\", \"contato@atleticaunisal.com.br\");\r\n$subject = \"Sending with SendGrid is Fun\";\r\n$to = new SendGrid\\Email(\"Atlética UNISAL\", \"contato@atleticaunisal.com.br\");\r\n$content = new SendGrid\\Content(\"text/html\", \"and easy to do anywhere, even with PHP\");\r\n$mail = new SendGrid\\Mail($from, $subject, $to, $content);\r\n$apiKey = getenv('myapikey');\r\n$sg = new \\SendGrid($apiKey);\r\n$response = $sg->client->mail()->send()->post($mail);\r\n\r\necho $response->statusCode();\r\nprint_r($response->headers());\r\necho $response->body();\r\n```\r\n\r\n2. Here is the error:\r\n\r\n```shell\r\n[Fri Mar 23 20:20:57 2018] PHP Fatal error:  Uncaught Error: Call to undefined function SendGrid\\mb_convert_encoding() in /home/ubuntu/Github/Email-PHP/exemplo 2/sendgrid-php/lib/helpers/mail/Mail.php:729\r\nStack trace:\r\n#0 /home/ubuntu/Github/Email-PHP/exemplo 2/index.php(11): SendGrid\\Content->__construct('text/html', 'and easy to do ...')\r\n#1 {main}\r\n  thrown in /home/ubuntu/Github/Email-PHP/exemplo 2/sendgrid-php/lib/helpers/mail/Mail.php on line 729\r\n[Fri Mar 23 20:20:57 2018] 127.0.0.1:53082 [500]: /exemplo%202 - Uncaught Error: Call to undefined function SendGrid\\mb_convert_encoding() in /home/ubuntu/Github/Email-PHP/exemplo 2/sendgrid-php/lib/helpers/mail/Mail.php:729\r\nStack trace:\r\n#0 /home/ubuntu/Github/Email-PHP/exemplo 2/index.php(11): SendGrid\\Content->__construct('text/html', 'and easy to do ...')\r\n#1 {main}\r\n  thrown in /home/ubuntu/Github/Email-PHP/exemplo 2/sendgrid-php/lib/helpers/mail/Mail.php on line 729\r\n```\r\n\r\n#### Technical details:\r\n\r\n* sendgrid-php Version: 5.6.0\r\n* PHP Version: 7.2\r\n* OS: Ubuntu 16.04\r\n* Installed packages: curl, postfix and soap\r\n* Curl enabled in `php.ini`\r\n"},"comment":{"url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/comments/375829326","html_url":"https://github.com/sendgrid/sendgrid-php/issues/591#issuecomment-375829326","issue_url":"https://api.github.com/repos/sendgrid/sendgrid-php/issues/591","id":375829326,"user":{"login":"thinkingserious","id":146695,"avatar_url":"https://avatars0.githubusercontent.com/u/146695?v=4","gravatar_id":"","url":"https://api.github.com/users/thinkingserious","html_url":"https://github.com/thinkingserious","followers_url":"https://api.github.com/users/thinkingserious/followers","following_url":"https://api.github.com/users/thinkingserious/following{/other_user}","gists_url":"https://api.github.com/users/thinkingserious/gists{/gist_id}","starred_url":"https://api.github.com/users/thinkingserious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinkingserious/subscriptions","organizations_url":"https://api.github.com/users/thinkingserious/orgs","repos_url":"https://api.github.com/users/thinkingserious/repos","events_url":"https://api.github.com/users/thinkingserious/events{/privacy}","received_events_url":"https://api.github.com/users/thinkingserious/received_events","type":"User","site_admin":false},"created_at":"2018-03-24T00:08:54Z","updated_at":"2018-03-24T00:08:54Z","author_association":"MEMBER","body":"Hello @gusbemacbe,\r\n\r\nI believe [this is the solution](https://github.com/sendgrid/sendgrid-php/issues/425#issuecomment-326439579). Please try it out and let me know how it goes. Thanks!\r\n\r\nWith Best Regards,\r\n\r\nElmer"}}
{"actor":{"display_login":"thinkingserious"}}