I’m using PHPMailer to send out some emails. I have a testing environment set up so that it shows me what the email looks like before I send it, and it looks fine. But when I receive the email I sent myself with the program, it’s a fat chunk of text with no line breaks. It is in plain text, and the problem is, I have a mail template so that people can customize their emails, but phpmailer doesn’t seem to recognize when the enter key starts a new line.
Beyond this, I don’t know what else to change because the email shows up nicely for me before I go to send it, so I’m guessing it’s some interaction between my text and PHPMailer. It also sends messages separately according to where I pressed “enter”. Any advice would be greatly appreciated!
what i want it to look like
what the email looks like right now
Things I’ve tried
- changing field isHTML to true and false
- adding line breaks to the messages in my code
- changing the encoding of the mail
Lucy Huang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.