frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
22k stars 7.38k forks source link

Unable to send Sales invoices to customers #39993

Open DavisonBelemu opened 9 months ago

DavisonBelemu commented 9 months ago

Information about bug

Good day I'm unable to send invoices via email to customers directly from the system. It seems to work sometimes when i pick the option to physically attach the email however I would like to be able to pick the attachment automatically.

When i check my error log its says email sending failed. I have attached the error log in the log output section.

Module

accounts

Version

v14.13.0 - v14.23.0

Installation method

None

Relevant log output / Stack trace / Full Error Message.

Error
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 135, in send
    message = ctx.build_message(recipient.recipient)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 294, in build_message
    message = self.include_attachments(message)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/email_queue/email_queue.py", line 353, in include_attachments
    print_format_file = frappe.attach_print(**attachment)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 2075, in attach_print
    content = get_print(doctype, name, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 2028, in get_print
    return get_pdf(html, options=pdf_options, output=output)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py", line 38, in get_pdf
    filedata = pdfkit.from_string(html, options=options or {}, verbose=True)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pdfkit/api.py", line 75, in from_string
    return r.to_pdf(output_path)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pdfkit/pdfkit.py", line 201, in to_pdf
    self.handle_error(exit_code, stderr)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pdfkit/pdfkit.py", line 155, in handle_error
    raise IOError('wkhtmltopdf reported an error:\n' + stderr)

 Queue Name: 87
Dharanipath1 commented 3 months ago

Any Updates? @DavisonBelemu

DavisonBelemu commented 3 months ago

Hi @Dharanipath1 I have not resolved this issue yet

Dharanipath1 commented 3 months ago

@DavisonBelemu In the site_config.json file located at: frappe-bench/sites/{yoursitenamehere}/site_config.json add the following line: "host_name": "http://www.yoursite.com"