Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent header from email when sending from swift mailer in symfony

Am using swift mailer to send email.It is working fine but in email it is sending the header information.How can I prevent it to send header information in email.It is like:

 HTTP/1.0 200 OK Cache-Control: no-cache Date: Thu, 10 Jul 2014 14:42:58 GMT
 Hello User

 Here is your email content
like image 327
Randhir Avatar asked Jan 28 '26 17:01

Randhir


1 Answers

you need to use renderView() instead of render()

renderView() returns the content of the view.

render() returns the Responseobject.

as the docs says

like image 167
Dario Rusignuolo Avatar answered Jan 30 '26 06:01

Dario Rusignuolo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!