1 (edited by boxygen 07/24/2016 04:46:44 pm)

Topic: Sending document by email failed

I am unable to send Invoice through email

http://fa.boxygen.biz/fa2325/sales/customer_invoice.php?UpdatedID=19

Username: aeronvista
pass: usayed2005

click email invoice and you will find the error message. This is the fresh installation of FA2.3.25

Can anyone help me with the solution of this? How can I find the reason of this error?

I then checked my server whether it is limiting emails or not but I found that emails are going perfectly from my server

http://my.boxygen.biz/test-email/index.html

The above is the email testing.

www.boxygen.pk

2 (edited by apmuthu 07/22/2016 01:18:21 pm)

Re: Sending document by email failed

Lines 1029-1040 of the the function End() in reporting/includes/pdf_reports.inc:

     if ($mail->send()) $sent++;
 } // foreach contact
unlink($fname);
$this->SetLang(user_language());
if (!$try) {
    display_warning(sprintf(_("You have no email contact defined for this type of document for '%s'."), $this->formData['recipient_name']));
} elseif (!$sent)
    display_warning($this->title . " " . $this->formData['document_number'] . ". "
        . _("Sending document by email failed") . ". " . _("Email:") . $emails);
else
    display_notification($this->title . " " . $this->formData['document_number'] . " " 
        . _("has been sent by email to destination.") . " " . _("Email:") . $emails);

The variable $sent is false or 0. This is because the first line above failed, ie., $mail->send() failed. It is clear that the value of $contact['email'] is okay as the error clearly displays it as: INVOICE 3. Sending document by email failed. Email: faisalayub1980@gmail.com

Inspect the values of the variables: $msg and the object properties of $mail at this point and see what is missing.

Re: Sending document by email failed

This might be your host requires smtp authentication to send e-mails

Subscription service based on FA
HRM CRM POS batch Themes

Re: Sending document by email failed

boxygen wrote:

I then checked my server whether it is limiting emails or not but I found that emails are going perfectly from my server

http://my.boxygen.biz/test-email/index.html

The above is the email testing.

With the above small script it is checked that server is not limiting emails due to smtp authentication. It is a simple email program with php mail function and going through perfectly on the same server and domain.

www.boxygen.pk

Re: Sending document by email failed

I found that my server is limiting all emails if the email address defined in the company setup is not from the domain hosted on the same server.

I did one modification in the line 47 of /reporting/includes/class.mail.inc and my problem got solved

boxygen wrote:

//        $this->header = "From: $name <$mail>\n"; Modified by Faisal to enable sending email by domain boxygen.biz
        $this->header = "From: $name <mail@boxygen.biz>\n";
        $this->header .= "Reply-To: <$mail>"."\n";

I replaced the Line 47 with next two lines.

www.boxygen.pk

6 (edited by apmuthu 07/29/2016 06:09:14 am)

Re: Sending document by email failed

This mod needs to be used with caution on a case by case basis as you do not want the mail recipients to get confused with mail appearing from some third party hosted FA which might point to a different domain than desired.

Anyway, thanks to your attention  to detail for sharing the fruits of your perseverance , we have one more issue "solved".