Send Email is not working with error in logs

Hi please can someone help, i have this issue, im trying to use the email to send but i get this error in the logs

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 425, in sendmail
recipients=recipients, cc=cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 207, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 140, in _notify
prepare_to_notify(doc, print_html, print_format, attachments)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 250, in prepare_to_notify
print_format=print_format, html=print_html))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1227, in attach_print
“fcontent”: get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1210, in get_print
return get_pdf(html, output = output)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 68, in from_string
return r.to_pdf(output_path)
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py”, line 143, in to_pdf
raise IOError(“wkhtmltopdf exited with non-zero code {0}. error:\n{1}”.format(exit_code, stderr.decode(“utf-8”)))
IOError: wkhtmltopdf exited with non-zero code -6. error:
The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.The switch --print-media-type, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display

and this

edddbdf5e37f0e10a8’, u’last_updated’: ‘2017-06-16 15:25:11.896994’, u’lang’: u’en-US’, u’user_type’: None, u’user’: u’Administrator’, u’full_name’: None, u’device’: u’desktop’, u’session_ip’: u’109.177.200.146’}, u’user’: u’Administrator’, u’sid’: u’410a388be200e586faf7bb30798358c053ca8e9aa74327cb6bc26650’}, ‘communication_name’: ‘3393b82fac’, ‘print_format’: u’Standard’}, ‘async’: True, ‘job_name’: u’<function sendmail at 0x7f56dc745f50>’}
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 66, in execute_job
method(**kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 425, in sendmail
recipients=recipients, cc=cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/communication.py”, line 207, in _notify
_notify(self, print_html, print_format, attachments, recipients, cc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 140, in _notify
prepare_to_notify(doc, print_html, print_format, attachments)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/communication/email.py”, line 250, in prepare_to_notify
print_format=print_format, html=print_html))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1227, in attach_print
“fcontent”: get_print(doctype, name, print_format=print_format, style=style, html=html, as_pdf=True, doc=doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1210, in get_print
return get_pdf(html, output = output)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py”, line 17, in get_pdf
pdfkit.from_string(html, fname, options=options or {})
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py”, line 68, in from_string
return r.to_pdf(output_path)
File “/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py”, line 143, in to_pdf
raise IOError(“wkhtmltopdf exited with non-zero code {0}. error:\n{1}”.format(exit_code, stderr.decode(“utf-8”)))
IOError: wkhtmltopdf exited with non-zero code -6. error:
The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.The switch --print-media-type, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display

Welcome to erpnext sealcoatings!

A search on the above error turned up this thread that may help

Great thanks for that, now i have this other issue it is saying

(553, '5.7.1 admin@example.com: Sender address rejected: not owned by us

ile “/home/frappe/frappe-bench/apps/frappe/frappe/email/queue.py”, line 370, in send_one
smtpserver.sess.sendmail(email.sender, recipient.recipient, encode(message))
File “/usr/lib/python2.7/smtplib.py”, line 747, in sendmail
raise SMTPRecipientsRefused(senderrs)
SMTPRecipientsRefused: {u’admin@example.com’: (553, ‘5.7.1 admin@example.com: Sender address rejected: not owned by user no-reply@mbgt.com’)}

ok two options to suggest here in this case :wink:

search on ‘Sender address rejected: not owned by us’

Or look up email setup docs https://frappe.github.io/erpnext/user/manual/en/

You get the self-help idea here I think!

Great thank you so much for your help, i got it to work:)
One last thing, when creating a new email addresses in the account settings, how do i tell the system to use the purchase email address for sending Purchase orders and Sales email address for invoicing? i can see when i click send email there is nowhere to select

Sorry and another thing when creating a new PDF layout for sending mail. i cant seem to find how i can add the logo of the company