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

Add attachment with setHtml() not work #31

Open
nguereza-tony opened this issue May 3, 2019 · 1 comment
Open

Add attachment with setHtml() not work #31

nguereza-tony opened this issue May 3, 2019 · 1 comment

Comments

@nguereza-tony
Copy link

When I use the code below:
php $email->setFrom('from@example.com', 'From') ->setTo('to@example.com', 'TO') ->setSubject('Mail \'subject') ->setReplyTo('reply@hhhh.com') ->setHtml() ->setMessage('My message') ->addAttachment('htaccess.txt') ->send();
I get the mail like this:
This is a multi-part message in MIME format. --27a6f9f7396604b2e7d9002567a15c0b Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable My message --27a6f9f7396604b2e7d9002567a15c0b Content-Type: application/octet-stream; name="=?UTF-8?B?aHRhY2Nlc3MudHh0?=" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="=?UTF-8?B?aHRhY2Nlc3MudHh0?=" PElmTW9kdWxlIG1vZF9yZXdyaXRlLmM+CglSZXdyaXRlRW5naW5lIE9uCglSZXdyaXRlQ29uZCAl e1JFUVVFU1RfRklMRU5BTUV9ICEtZgoJUmV3cml0ZUNvbmQgJXtSRVFVRVNUX0ZJTEVOQU1FfSAh LWQKCVJld3JpdGVSdWxlIF4oLiopJCBpbmRleC5waHAvJDEgW0xdCjwvSWZNb2R1bGU+ --27a6f9f7396604b2e7d9002567a15c0b--

But if I remove the method setHtml()

php $email->setFrom('from@example.com', 'From') ->setTo('to@example.com', 'TO') ->setSubject('Mail \'subject') ->setReplyTo('reply@hhhh.com') //->setHtml() ->setMessage('My message') ->addAttachment('htaccess.txt') ->send();

I get the mail with attchment

@ghost
Copy link

ghost commented May 14, 2019

The project was abandoned by the developer, therefore I recommend reading and learning yourself https://www.php.net/manual/en/function.mail.php

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

1 participant