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

Compose Mail with attachContent error data too long for DB #41

Open
wisaruthk opened this issue Mar 21, 2018 · 2 comments
Open

Compose Mail with attachContent error data too long for DB #41

wisaruthk opened this issue Mar 21, 2018 · 2 comments

Comments

@wisaruthk
Copy link

wisaruthk commented Mar 21, 2018

I have use function attachContent to attach pdf content. And got Data too long for column.
Database: MySql

$cmd = Yii::$app->mailer->compose()->setFrom()->setTo()->setSubject();

$cmd->attachContent($attachContent,["fileName"=>"name.pdf"]);

$cmd->queue();

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'swift_message' at row 1

For workaround I have change the column swift_message from text to long text.

@nterms
Copy link
Owner

nterms commented Mar 21, 2018

@wisaruthk glad you got is solved. Long text can contain up to 4GB of data. Can't imagine a better solution right now.

@marcogermani87
Copy link
Contributor

Fixed with pull request #37

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

3 participants