1

When I send a message with a string attachment, the string attachment when opened only gives a 1 and in the email sorce it says

--b1_5a1a74831dfa0ce86353d222b95078c6
Content-Type: text/html; name="apperley-invoice-20017.html"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="apperley-invoice-20017.html"

MQ==


--b1_5a1a74831dfa0ce86353d222b95078c6--

Im using this code to add the attachment:

$mail->AddStringAttachment($invoicehtml,$filename,'base64','text/html');
Rlweb
  • 69
  • 2
  • 10

3 Answers3

0

I'm not sure about the source of your problem but I think think you should try SwiftMailer instead.

Alix Axel
  • 151,645
  • 95
  • 393
  • 500
0

Check out this here:

PHPMailer, AddStringAttachment and Data URI Scheme

Based on the fact that you are getting a base64 result, I'd imagine you either need to change the encoding method to quoted-printable or 8-bit, or decode the $invoicehtml first.

Community
  • 1
  • 1
Gazler
  • 83,029
  • 18
  • 279
  • 245
0

I'd bet that $invoicehtml contains 1. Check your inputs.

Synchro
  • 35,538
  • 15
  • 81
  • 104